skip reading headers in matlab

Posted by Paul on Stack Overflow See other posts from Stack Overflow or by Paul
Published on 2010-04-06T20:23:48Z Indexed on 2010/04/06 21:13 UTC
Read the original article Hit count: 192

Filed under:

I had a similar question. but what i am trying now is to read files in .txt format into matlab. My problem is with the headers. Manytimes due to errors the system rewrites the headers in the middle of file and then matlab cannot read the file. IS there a way to skip it? I know i can skip reading some characters if i know what the character is.

here is the code i am using.

[c,pathc]=uigetfile({'*.txt'},'Select the data','V:\data);
file=[pathc c];
data= dlmread(file, ',', 1,4);

this way i let the user pick the file. My files are huge typically [ 86400 125 ] so naturally it has 125 header fields or more depends on files.

Thanks

Because the files are so big i cannot copy , but its in format like

day time col1 col2 col3 col4 ...............................
2/3/2010 0:10 3.4 4.5 5.6 4.4 ...............................
..................................................................
..................................................................

and so on

© Stack Overflow or respective owner

Related posts about matlab