How to read a csv with 30000 rows of data which are both numbers and texts?

How I can read a csv which contains about 30.000 rows of data that are both text and numbers? I have tried with xlsread and readtable commands but it stores the first 12650 rows.

답변 (1개)

Walter Roberson
Walter Roberson 2015년 11월 27일
You will probably need to use textscan()
Does the file have the same number of fields on each line?
Is it possible that the file changes formats after 12650 lines?

댓글 수: 4

The file doen't have the same number of fields on each line. There is a pattern in every 1000 rows approximately. When I read with xlsread it stores 12745 rows and when I read with readtable it stores 12637 rows.
I noticed that if I convert this file to xlsx and try to read in matlab it reads all the rows (30770) using both xlsread command and readtable command.
Ah. The problem is solved for your purposes then?
Yes I suppose, but I can't understand the reason...

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

카테고리

태그

질문:

2015년 11월 27일

댓글:

2015년 11월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by