How to use "str2num" to read the first column of a comma separated data?
Mostrar comentarios más antiguos
I have a data file that consists of 8768 lines. The first 9 lines are header lines that are not in my interest. the lines below the header lines are tabular data with commas separating the elements of each column. The first column is a 4-digit number that states the year (e.g 1997).
My question is: How can I get the years from each row? (which is the same as the first 4 digits or the row or the digits before the first comma) and the command shall contain "str2num" notation.
Respuestas (1)
Matt Kindig
el 2 de Abr. de 2012
str2num isn't really intended for this purpose. Why not use textscan, dlmread, or similar?
doc textscan
doc dlmread
Categorías
Más información sobre Large Files and Big Data en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!