How can i read a csv file

3 次查看(过去 30 天)
How can i read a csv file. i used fopen but it gives a value of -1
A=fopen('slip.csv')

采纳的回答

Walter Roberson
Walter Roberson 2012-10-15
csv files are text files, usually written in ASCII or ISO-8896-1 (which is compatible with ASCII).
  4 个评论
Lisa Justin
Lisa Justin 2012-10-18
Hi Walter, i also want to creat a file list of the large csv data i have. when i write dir *.csv i get all data displayed but when i try to write a script say
dir=('C:\Lisajustin\Vib')
Listdir=sprintf('%d%d',dir, '\*.csv');
i get error message ??? Error using ==> sprintf Function is not defined for 'struct' inputs.
what could be the problem

请先登录,再进行评论。

更多回答(1 个)

Sachin Ganjare
Sachin Ganjare 2012-10-16
You can use 'csvread' function. Refer link below for further details:
Hope it helps!!!

类别

Help CenterFile Exchange 中查找有关 Low-Level File I/O 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by