How to read different csv files?

조회 수: 1 (최근 30일)
noname
noname 2018년 3월 24일
댓글: Star Strider 2018년 3월 24일
If I have 100 csv files, and each csv file has different format within the file. For example: some csv do have ",", some don't but only have space, and some contain text. I use uigetfile to open multiple files, but I don't know read each file since each of them may be different. Can anyone help me with this? Thank you for your time.

채택된 답변

Star Strider
Star Strider 2018년 3월 24일
The readtable (link) function would be my preference. It is very good at reading files with different data formats. (It was introduced in R2013b.)
  댓글 수: 2
noname
noname 2018년 3월 24일
Thanks!!
Star Strider
Star Strider 2018년 3월 24일
As always, my pleasure!
You can use the table2array function to create a numeric array from the table.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by