Test and Measurement Forum

Import multiple .psd to Excel

Forum for discussing PicoScope (version 5)

Import multiple .psd to Excel

Postby Michael Hayes » Fri Aug 20, 2004 12:13 am

I have had several applications where I have created a sequence of .psd files from an ADC212 which has been left to trigger on an external event. There may be from 2 to 50 files which are created. I can open Picoscope and manually do a "save as" text on each file but even using page down to access the next file this is tedious. While mentioning this, it is also worth noting that the file extension does not automatically change to .txt for the second and subsequent files which makes the job a little longer.
When I import these files to Excel, I have written some VB code and then enter the path, base filename and the range of suffix digits to import and I get each file read in as a new sheet named after the imported file, with time, ChA and ChB in the first three columns. This allows me to overlay multiple events on one graph, or process in any other way I wish.
Ideally, I would like to read the .psd's into excel directly and have read the post on this forum "PSD binary file format" I have not been able to get this to work despite help from someone who understands C.
Do you have any tools available or a .exe of this program or similar which will run under XP and allow me to give a path, filename and suffix extension range to enable conversion of the data to a .txt or .csv format?
Michael Hayes
 

Postby Sarah » Fri Aug 20, 2004 11:42 am

Hi Michael

Thank you for your post.

There is a command line you can use to convert multiple .psd files to .txt files. To achieve this you need to do the following:

1 Close PicoScope for Windows
2 Open a DOS box
3 Go to the directory containing the files that you wish to convert to text
4 Type in the following command: psw -t run*.psd

This command will convert any .psd data file with run as the first three letters into the corresponding run*.txt

Hope this helps.

Best Regards
Sarah
 

Postby Michael Hayes » Tue Aug 24, 2004 7:04 am

Sarah,
Thanks for the advice. It worked to a degeree but was a little messy. I am using the latest version of PSW and ended up moving a copy of the exe to my dummy directory as it is too long since I have played with path commands. I then found I had to type
psw32 -t run*.psd
This gave a number of errors firstly a <string resource not found> with an ok button then the same error with yes no buttons I pressed yes and it slowly opened each file in Picoscope and saved them as .txt

The actual file created does not have a heading or the unit (µS / mV etc).
This is easier than doing the same thing manually but requires further work to label the data.

Is there a way within Windows XP to use another method which does not involve dos boxes? It is all but impossible to find data within our work file structure via dos paths.

Regards,
Michael
Michael Hayes
 

Postby Sarah » Wed Aug 25, 2004 10:01 am

Hi Michael

Sorry to hear you are still having some problems.

Unfortunately, the method I described is the only other way of saving files as .txt files besides doing it manually. You could however write your own software which you could then use to save the files in the format that you desire.

Best Regards
Sarah
 


Return to PicoScope 5

Who is online

Users browsing this forum: No registered users and 0 guests