How to read a large CSV in chunks;
조회 수: 3 (최근 30일)
이전 댓글 표시
I have the following code which filters a very large CSV.
opts = detectImportOptions('Z_EnergySequence.dat');
data = readtable('Z_EnergySequence.dat',opts);
tol = 1e-6;
filter = 4.125;
filterreddata = data(abs(data.X - filter) < tol, :);
filteredions = data(ismember(data.IonN, filterreddata.IonN),:);
filteredions(1:2:end,:)= [];
writetable(filteredions, 'Published/Z_EnergySequence1.csv');
I think I may be getting errors in the data processing. Is there a way in which I can read the whole CSV in chunks and output to the same file?
댓글 수: 1
답변 (1개)
Rishi Binda
2018년 8월 28일
If you want to read specific range of the generated csv file you can use one of the following :
- csvread
- dlmread
- xlsread
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!