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

 Réponse acceptée

Star Strider
Star Strider le 29 Déc 2014

0 votes

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

4 commentaires

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.
Star Strider
Star Strider le 29 Déc 2014
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
Jana le 5 Mar 2015
Thanks. Actually, xlsread does all the job - I just didn't know that it has modes. Thanks for the kick! :-)
Jana
Star Strider
Star Strider le 5 Mar 2015
My pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by