reading data of non-standard format

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

 Accepted Answer

Star Strider
Star Strider on 29 Dec 2014
If you can export it to an Excel file, use the xlsread function to read it.

4 Comments

JCU’s Answer moved here ...
I tried that. But it does not work with text. The format is something like:
Species name Island name On-island activity Total
Ardenna pacifica Heron Island Nesting
Anous minutus One Tree Island Nesting 447
Anous minutus Heron Island Nesting
Accipiter fasciatus St Bees Island Present
Accipiter fasciatus St Bees Island Present 1
Accipiter fasciatus St Bees Island Present 1
Acrocephalus australis Bell Cay Present 1
Actitis hypoleucos Fairfax Islands (No 2) Present 1
e.g. Accipiter fasciatus is in one column, St Bees Island in the second etc.
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.
Thanks. Actually, xlsread does all the job - I just didn't know that it has modes. Thanks for the kick! :-)
Jana

Sign in to comment.

More Answers (0)

Asked:

on 29 Dec 2014

Commented:

on 5 Mar 2015

Community Treasure Hunt

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

Start Hunting!