removing speech marks from data

Hi,
I've not got a lot of experience with matlab so I apologise if it seems like a waste of time. I have a straightforward problem (hopefully). I am importing data in csv format, however the wizard cannot distinguish the data from the text header because it is in speech marks. I was wondering whether there is a simple way to remove the speech marks? I'm on quite a brief summer internship so I would really appreciate your help.
Many Thanks
Luke

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2011년 7월 15일

0 개 추천

What do you mean speech marks? If it is text header, can you simply ignore them and import the numeric data only. When you do the import through wizard, you can specify the number of text header lines. Try to type the following command in the MATLAB command window and see what you got.
Data=importdata('MyDataFile.csv')

댓글 수: 3

Luke Parry
Luke Parry 2011년 7월 18일
Thank you for your respnse. okay so the problem is that I'm recieving the data in a format like this:
<header> (12 lines)
"19.419,19.233,19.304"
"19.43,19.237,19.311"
...
I can specify the number of header lines but due to the speech marks around every set of 3 data points, the wizard does not recognise the data as numeric. Is there any way to remove/ignore the speech marks so that the data can be imported?
Cheers
Luke
Walter Roberson
Walter Roberson 2011년 7월 18일
You can use textscan() with the double-quote included in your Whitespace parameter.
Walter Roberson
Walter Roberson 2011년 7월 18일
Include comma in the Whitespace list as well to make parsing easier.

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

카테고리

도움말 센터File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

태그

질문:

2011년 7월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by