How to open a .txt file with header information
Show older comments
I have a large data file, temperature data to be exact, the file output from the sensor is .txt. The first 12 rows are header rows, which I'd like to ignore completely and just focus on the data that is left.
Any help would be greatly appreciated.
Answers (2)
Ameer Hamza
on 8 May 2018
Try readtable()
data = readtable(filename, 'HeaderLines', 12);
Fangjun Jiang
on 8 May 2018
Edited: Fangjun Jiang
on 8 May 2018
0 votes
importdata(FILENAME, DELIM, NHEADERLINES) loads data from ASCII file FILENAME, reading numeric data starting from line NHEADERLINES+1.
4 Comments
flemingtb
on 8 May 2018
Fangjun Jiang
on 8 May 2018
Edited: Fangjun Jiang
on 8 May 2018
Can you paste a snippet of your text data? The error message indicates the delimiter you specified ('/t') is not allowed. Use '\t' for tab.
Fangjun Jiang
on 8 May 2018
all the numerical data are in one line. There is no carriage return. Please attach a text file.
Categories
Find more on Text Files 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!