import data from txt missing delimiters
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Christian von Spreckelsen
il 22 Mag 2016
Commentato: Todd Leonhardt
il 22 Mag 2016
I am struggeling with importing data from a .txt file in my script, and i believe it is due to a '$' in my first coloumn. I have tried using csvread, textscan and importdata. The only thing i got to work was importdata, but it ignores the delimiters.
This is the command i use: "test = importdata(fullpathname,',')"
It gives me a 1291x1 array, which should have been a 1291x10.
I have attached the file im trying to import. Anyone got an idea how to import the data in different coloumns?
Thanks!
0 Commenti
Risposta accettata
Todd Leonhardt
il 22 Mag 2016
It works very well with delimited files. It also allows you to specify an optional 'Format' if it doesn't work correctly out of the box.
3 Commenti
Todd Leonhardt
il 22 Mag 2016
For the format string, try something like:
'$%n%n%n%n%n%n%n%n%n%n#'
And since all of your numbers look like integers, maybe consider replace the "%n" which signifies a double precision float with %u for unsigned integer or %d for signed integer.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Large Files and Big Data in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!