Cannot Load CSV file

조회 수: 7 (최근 30일)
romulo alves
romulo alves 2018년 7월 31일
댓글: Walter Roberson 2018년 8월 1일
I am trying to load a csv file using the import tool.
It takes forever (like a weekend was not enough...).
I've included the screenshot of what I am doing.
The file has numbers from H2 to AEQ639774. From A1 to AEQ1 I have headers. From A2 to G639774 I have identifiers.
I was trying to first load the numbers into a numeric matrix, and then repeat the process for headers and identifiers separately. But not even this works.
The file is 1.28 GB.. so big but not that big.
My machine has 16gb ram so that should be enough.
I am probably doing something wrong!
Thanks in advance!

채택된 답변

Adam Danz
Adam Danz 2018년 7월 31일
That sounds fishy. What version of matlab are you using? I assume the problem persists after exiting and rebooting Matlab.
You could try rehashing the toolbox cache in case 3rd party toolboxes are interfering.
You could use an alternative method of importing the data such as xlsread() which bypasses some of the processing done by the import tool.
  댓글 수: 15
Walter Roberson
Walter Roberson 2018년 7월 31일
The 'e' and 'r' are probably the reason that most numbers are coded as if they are strings.
What do you want done with the 'e' and 'r' ? Is it okay to treat both of them the same way as empty cells, by changing all three of them into NaN ?
Walter Roberson
Walter Roberson 2018년 8월 1일
The file turns out to be UTF8 encoded, because it contains accented characters at various points. That leads to some problems.
I started working with reading in the entire file at one time to process as a single string (there can be a lot of advantages to working that way), but I encountered a Mathworks bug with native2unicode at the point of 1 gigabyte of decoded characters.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Text Data Preparation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by