string inside a table
이전 댓글 표시
hi guys:
i export csv files from an url by using urlwrite and readtable commands. the resulting table is (or should be) composed of numbers, somehow some table cells has the value '-'. Because of this, the whole column containing that string '-' become into string values, like this:
column1 column2
------- -------
'12' 34
'10' 12
'-' 20
'1.1' 13.1
'34.9' 66
is there a way to avoid it? i mean, the whole table as numbers...
thanks
댓글 수: 3
Jan
2017년 9월 20일
Before we can suggest, how to solve this, we need to know, what you want to appear instead of the '-'. Is NaN okay?
Walter Roberson
2017년 9월 20일
Is it possible that the original data contained "- 20" with a space between the "-" and the "20" ?
eric capnu
2017년 9월 20일
채택된 답변
추가 답변 (1개)
Jeremy Hughes
2017년 9월 21일
Try:
>> T = readtable(filename,'TreatAsEmpty',{'-'})
Jeremy
카테고리
도움말 센터 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!