Read text file with fixed width columns and mixed data types
11 views (last 30 days)
Show older comments
I want to read the data columns similar to the attached file "wds00524-6930.txt". The format of the file is explained fully in the "datarequest_key.txt". Briefly, the data begins on line 12 and each line has 25 data columns making a width of 121 per data line. For example, the first column of data has a format of f10.5 and is from width 008 to 017. Some columns have data types 'double' others 'string'. I have tried all sort of ways to read this but have always resorted to importing the text file into excel and selecting what I want and saving it as a csv or xlsx file . This works well on an individual file basis, but I want to be able to read hundreds-thousands of text files in the same format.
1 Comment
Answers (1)
See Also
Categories
Find more on Standard File Formats in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!