Read data from CSV that contains multiple tables one after the other vertically
Show older comments
Hello,
I would be really thankful if someone an help me with this. Please do mind I'm relatively new to Matlab. This might be easy to do but I can't seem to find how to do it.
I have a large csv file (26000+ rows) that contain multiple tables one after the other. each table has a name stated in the row after "[Name]". and the data corresponding to that table is given in the rows following "[Data]". Please see the attached image. The data are times vs velocities. The times of each table is same. I need to get the data into one matrix, which would have the data as time in 1st column, and the velocities corresponding to the times for each point in the following rows. i.e. 1st column time, 2nd column velocity of point 0, 3rd column velocity of point 1, 4th column velocity of point 2 etc. The tables are not in the order of the points. So the name should be read and assigned to the particular pint, if that makes any sense.
I would be really thankful if someone can help me with this please.
I have attached a sample data set also.
Thanks in Advance,
Dilshan.

6 Comments
Mathieu NOE
on 5 Nov 2020
hello
I worked hard for you today !!
attached the main script (can loop over multiple csv input files ) + a subfunction to process each individual csv file.
tested on your file, I send my xls output file
hope it fullfills your dreams ! :)
all the best
casseer15
on 6 Nov 2020
Mathieu NOE
on 6 Nov 2020
glad it helped !!
please "accept" my answer so my teacher will give an image for my homework ! :)
Mario Malic
on 6 Nov 2020
Hi Mathieu, your comment is in comments section and can't be accepted as an answer.
Mathieu NOE
on 6 Nov 2020
will do :)
Accepted Answer
More Answers (0)
Categories
Find more on Time Series Events 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!