Sunday, 15 January 2012

csv - MATLAB: Import a very large file in batches -


I am trying to import a large CSV file (215000X3) in 50 batches. 'Textscan' I used this code below

  N = 50; Fid = fopen ('PIDFile.csv'); FormatSpec = '% s% s% s'; K = 0; While ~ feof (fid) k = k + 1; Block = textscan (fid, formatSpec, N, 'delimiter', ',');  

After running this part of the code, I get 'block' as follows:

  34X1 cell 34X1 cell 34X1 cell  

The file being imported is a regular CSV file, I am looking at Fred, FSAN, CSVD etc. but not all the examples / sloths that offer block import.

Oh ok, any suggestions / comments will be highly appreciated

All I had to do was:

  block = cell2 matte (texasan (feed, format sapc, n, 'delimiter', ','));  

And the solution to that problem!


No comments:

Post a Comment