problem in using textscan to import data from csv

I need to import a csv file with 60 columns. All have numerical values. However, some values are missing and instead of keeping it as 0 or Nan, those columns have "*****" and when importing using textscan it gives an error.
So how can I replace those string parts (******) with NaN and import it as numbers.
so finally my requirement is to import the csv file to number arrays with replacing "*****"with NaN

댓글 수: 1

Could you give a couple of sample lines? And also please show your current textscan attempt.

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

답변 (1개)

dpb
dpb 2015년 12월 11일

0 개 추천

Filling a field with asterisks is Fortran convention if output magnitude exceeds available width for a field; possibly can you rework the application building the output file to correct such?
Failing that, use the 'TreatAsEmpty','******' option to cause textscan to return those fields as missing values.

카테고리

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

질문:

2015년 12월 11일

답변:

dpb
2015년 12월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by