Handling csv file in MATLAB

1 次查看(过去 30 天)
Yongmin
Yongmin 2014-12-4
评论: dpb 2014-12-4
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 个评论
dpb
dpb 2014-12-4
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by