Info

This question is closed. Reopen it to edit or answer.

Load csv file with multi lines of headers in matlab 2012a

1 view (last 30 days)
How to load a file like this in matlab2012a: ----------------------- Test Results as of 5/31/2013 Tester, ABC and DEF Tester,Result1, Result2 ABC, 1.2, 2.3 DEF, 0.5, 6.5 ABC, 4.5, 4.6 DEF, 3.3, 5.6 End of 5/31/2013 -----------------------
I need to store the date "5/31/2012" into a veriable and line 4 to line 8 to another.
  1 Comment
Ken Atwell
Ken Atwell on 3 Jun 2013
Edited: Ken Atwell on 3 Jun 2013
Cal, can you fix the carriage returns in your example? It is showing as just one long line, so I can't figure out where the line breaks should be.

Answers (1)

SpcCode
SpcCode on 31 May 2013
I think the best way is to get the data. As is probably will be split by spaces, but you can also look for the first '\', then you know how many numbers after/before should be there.
data = importdata("C:\text.txt");
  1 Comment
Cai
Cai on 3 Jun 2013
Is importdata available for 2012a? I just got upgraded from 2011a to 2012a and don't think I can get 2013a for a while.

Tags

Community Treasure Hunt

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

Start Hunting!