reading text file a matrix of string
Mostra commenti meno recenti
Hi, i have a large data file in which each row looks like this:
1/1/2012 00:05:00 0.45
all rows have the same format. i want to read it into matlab by using the command "tdfread". it works, but the first 2 columns comes out wrong, the third one is ok.
is there any way to make the command read the first two columns as a string/char and not as a scalar?
using "fopen" takes too long, thats why im trying to use this command.
thank you for your help.
6 Commenti
dpb
il 20 Ott 2013
So fast but wrong would be better than right but slow???
What is the delimiter and does the file have a header row that is allowable variable names?
Looks like if those conditions were followed tdfread should do the job. I doubt it'll be any faster than would be textscan or some of the alternatives, however...
Dany
il 20 Ott 2013
dpb
il 20 Ott 2013
doc tdfread
"... tdfread(FILENAME,DELIMITER) uses the specified delimiter in place of tabs.
doc textscan % alternatively.
Using fgetl is one record at a time; about as slow a technique as you could choose.
Dany
il 20 Ott 2013
Dany
il 20 Ott 2013
Risposte (0)
Categorie
Scopri di più su Text Data Preparation in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!