how to read several ascii text file in a folder and avoid the header in each text file

2 views (last 30 days)
I have several number of ascii text files in a folder. each text file contains a column data and a header lines. I wants to read the data from all the text files and arrange the data into a single variable. also I wants to read the header lines and extract the variables from the header files. how to make a program for that?

Answers (1)

dpb
dpb on 20 Sep 2014
Start w/ the FAQ...
I strongly recommend the DIR solution. As for the header, simply write an appropriate format string to parse the required data from it, then read the rest of the file. See the doc under textscan and friends for details and there are a zillion threads on the forum illustrating specific cases as guides as well as the examples in the documentation.

Community Treasure Hunt

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

Start Hunting!