.DAT file
11 views (last 30 days)
Show older comments
I have data that is in a .DAT format. The file contains header information about the test that was run and contains text and numbers. The data located below the header information and has two lines of text (data name and units below), then the numerical data is located below the units. The data is in columns and can vary in length depending on how long the data was recorded for. I would like to be able to separate out the header information from the data. I'm a newbee to MATLAB, so I'm grasping at how this can be done. I would normally use excel, however, there are at times more than 30k lines of data and excel cannot plot all the data easily. Thanks ! Sincerely, Bill D.
1 Comment
Walter Roberson
on 21 Nov 2011
There is no standard format for .DAT Files; as a file extension, it can mean anything. You will have to provide us with basic information about the file format including whether the numeric data is represented as text.
Answers (3)
Fangjun Jiang
on 7 Nov 2011
Provide a snip of your example .dat file will be helpful. Check out the function textscan(), it can skip header lines. For some files, you might be able to use importdata() and uiimport(). Once you went through one example, uiimport() can generate the necessary code to do the import in automation.
0 Comments
William Du Chene
on 18 Nov 2011
4 Comments
Fangjun Jiang
on 21 Nov 2011
Is the number of lines fixed for the header section? How many columns are there for the data section? These are the basic question need to be clarified before anyone can help you.
Walter Roberson
on 21 Nov 2011
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
See Also
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!