MATLAB Answers

Jana
0

reading data of non-standard format

Asked by Jana
on 29 Dec 2014
Latest activity Commented on by Star Strider
on 5 Mar 2015
Hi,
I need to read data like with non-standard format. There are columns with names, and their abundances (some of them may be empty). Names can be repeated, and contain spaces. I can export it into .xlsx file. I need to stuff it into some kind of matrix which I can process further (see which names are repeated and get the indeces of them etc.)
Any idea what can read it and what would be the matrix format?
Cheers,
Jana

  0 Comments

Sign in to comment.

1 Answer

Answer by Star Strider
on 29 Dec 2014
 Accepted Answer

If you can export it to an Excel file, use the xlsread function to read it.

  4 Comments

Show 1 older comment
I had no idea you had data in that format. I would use the interactive Import Data GUI (shortcut on the ‘VARIABLE’ section of the toolstrip above the Command Window), then save the imported variables as a .mat file.
I created a short .xlsx file with your headers and two lines of your data, and that was the only way I could successfully import them. That may seem inconvenient, but since you only have to do it once (then you can read the .mat file easily later), it may be your best option.
Jana
on 5 Mar 2015
Thanks. Actually, xlsread does all the job - I just didn't know that it has modes. Thanks for the kick! :-)
Jana
My pleasure!

Sign in to comment.