Using importdata function without importing the first line of text file

I am trying to import the data from different text files, but I don't want to import the first line of those files. My text files contain data like this.
So, I use the IMPORTDATA function to import all contents except the first line.
filename{k} = importdata (name{k}, ' ', 1);
While the name variable is a cell array that keeps the names of my files and filename is used to keep those contents. As my understanding, this function should return all content in the file except the first line and keep in the filename variable. However, when I printed out the value of filename, I got only the first line not the other content that I want. What I got is shown below.
So, is there anything I have missed? Please help!

 Accepted Answer

is there anything I have missed?
Yes, the data field of your filename structure, which as indicated in your screenshot contains a 4x3 double array which is the 4 remaining lines of your file.
As an aside, filename is a very misleading name for what that variable holds. filecontent would be a lot more accurate.

1 Comment

Oh! Thank you for your answer and suggestion, it is very helpful for me. I had really missed it. Lol.

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!