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

 채택된 답변

Star Strider
Star Strider 2014년 12월 29일

0 개 추천

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

댓글 수: 4

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 2014년 12월 29일
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 2015년 3월 5일
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 2015년 3월 5일
My pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

질문:

2014년 12월 29일

댓글:

2015년 3월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by