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

1 次查看(过去 30 天)
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?

回答(1 个)

dpb
dpb 2014-9-20
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.

类别

Help CenterFile Exchange 中查找有关 String Parsing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by