PDA

View Full Version : Motec .csv export



ben
05-06-2005, 03:52 AM
When I export a .csv file from Interpreter it puts speech marks either side of each value, is there any way of switching this off?

At the moment I can work around the problem by re-saving the .csv from Excel. My requirement is to read the file into Matlab but because of the speech marks it wants to store the values as strings not numbers.

Ben

ben
05-06-2005, 03:52 AM
When I export a .csv file from Interpreter it puts speech marks either side of each value, is there any way of switching this off?

At the moment I can work around the problem by re-saving the .csv from Excel. My requirement is to read the file into Matlab but because of the speech marks it wants to store the values as strings not numbers.

Ben

rowel3
05-06-2005, 10:15 AM
I don't know about Motec data formats. However, since you can get strings in Matlab, why not use the str2num command? Documentation can be found here: str2num help (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/str2num.html)

alfordda
05-06-2005, 03:56 PM
If your numbers are coming in as strings someting like '3', you will probably need to use strrep before the str2num command.

ben
05-07-2005, 06:59 AM
I know I can import a string into matlab but a line of the motec .csv looks like:

"0.1","0.3", etc

If you've got 1200 lines of this it becomes laborious even using string reading compared to textread or csvread on numeric data. Not a problem I can always just save in Excel which exports a sensible .csv with no speech marks in.

Ben