.DAT file

7 次查看(过去 30 天)
William Du Chene
William Du Chene 2011-11-7
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 个评论
Walter Roberson
Walter Roberson 2011-11-21
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.

请先登录,再进行评论。

回答(3 个)

Fangjun Jiang
Fangjun Jiang 2011-11-7
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.

William Du Chene
William Du Chene 2011-11-18
This is the header information:
numSysManualLogType=1
timSysManualLog=300
vsSysProjectFolder=11-01041
numSysTestRun=300
vsSysTestComment=pilot injection injector delivery 650 -1.5
vsSysDataFile=11-01041_300
vsSysTestStartDate=10-27-2011
I'm having problems pasting the data in, but in a nut shell, the top of the column is the variable name, below that is the units and finally, below that is the data. Hope this helps.. Thanks for the help !
Sincerely,
Bill D.
  4 个评论
Fangjun Jiang
Fangjun Jiang 2011-11-21
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
Walter Roberson 2011-11-21
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers

请先登录,再进行评论。


William Du Chene
William Du Chene 2011-11-22
The header data in my mind has two parts: First is the data in column A rows 1-58. Second is the main body of the data starting in Column F row 59. (Sorry for speaking excel here). The main body of the data concsists of two lines of header information, the name and units. The data follows the headers. The column data names will vary depending on how many variables are selected in the pre test set up. The header information in A1-58 can vary as well, but is a fixed in our out put for now. What I would like to do in read all of the data into Matlab, but if this is too complicated, I would settle for just the main body of data.
Sincerely, Bill D.

类别

Help CenterFile Exchange 中查找有关 Data Import and Analysis 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by