Handling csv file in MATLAB

1 view (last 30 days)
Yongmin on 4 Dec 2014
Commented: dpb on 4 Dec 2014
I want to read a csv file made by a DBMS.
If I load the csv file with uiopen, the first data (1st row, 1st column) shows an extended character that MATLAB cannot handle. However, the file can be read without any problem when Windows applications such Excel, Wordpad, or Notepad open it. For example, I attached a table showing "Import" window in MATLAB.
1 i≫¿0000062
2 00000ba
3 0000100
The first data is originally 0000062 but in MATLAB the characters, i≫¿, are inserted unintentionally.
Would you please suggest how to solve the problem? Many thanks!
  1 Comment
dpb on 4 Dec 2014
First check and see if there are any settings within the DBMS to change that can cause it to not write the bum data to begin with.
If that brings no joy, are the same characters extant in each and every file? If so, determine what they are or if there are always precisely the same number, read the file in as binary into a character array and delete those characters. Then either process the file from memory or rewrite it back out in uncorrupt form and use importdata or csvread or the like.

Sign in to comment.

Answers (0)


Community Treasure Hunt

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

Start Hunting!