How to read\open a csv file with millions of rows and hundreds of coloumns to compare/delete and save

조회 수: 1 (최근 30일)
Hi
i have csv files with millions of rows and hundreds of coloumns that i want to open\read in order to compare the files, remove duplicates and save the new file as csv also, and many other modifications..
when i used csvreader the PC stuck! so any help here
  댓글 수: 9
Shayma
Shayma 2016년 9월 21일
편집: Shayma 2016년 9월 21일
o.k it have been a long time now, but i got the R2014b,i tried to use datastore and it works, at least it opens the first chunk thank you :)
Shayma
Shayma 2016년 9월 22일
How long it suppose to take reading 100000 lines each chunk from 13.5 GB files ?

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

답변 (1개)

George
George 2016년 8월 12일
You can do this with textscan, but your formatSpec is going to be pretty gnarly.
fid = fopen('data.csv');
% your formatSpec will be very long because of the number of fields
formatSpec = '%s %s %f %d'; % reads a string, a string, a float, an integer
A = textscan(fid, formatSpec, 'HeaderLines', 1, 'Delimiter', ',');
fclose(fid);
csvread

카테고리

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