matlab - CSVIMPORT function not working for huge CSV? -
so i'm using this csvimport function, , i'm trying import csv file looks this:
2014-6-06 08:03:19, 439105, 1053224, front entrance 2014-6-06 09:43:21, 439105, 1696241, main exit 2014-6-06 10:01:54, 1836139, 1593258, archway 2014-6-06 11:34:26, 845646, external, exit 2014-6-06 04:45:13, 1464748, 439105, side exit
and on 948739 lines. basically, columns 2 , 3 represent peoples' id numbers, , describes calls made 1 person @ event(ex. 439105 calls 1053224). whenever calls outside of event, id shows "external".
i need import columns 2 , 3(ex. 439105 & 1053224). problem can code work on small csv file size , not big one... , according this question, csv file on million lines worked.
according documentation:
[c1 c2 c3] = csvimport( filename, 'columns', {'c1', 'c2', c3'}, ... ) form returns data columns in output variables c1, c2 , c3 respectively, column names case-sensitive , must match column name in file exactly. when fetching data in column mode number of output columns must match number of columns read or must one. in latter case data columns returned single cell matrix.
[c1 c2 c3] = csvimport( filename, 'columns', [1, 3, 4], ,'noheader', true, ... ) form returns data columns in output variables c1, c2 , c3 respectively, columns parameter must contain column indices when 'noheader' option set true.
so used this:
[c2 c3] = csvimport('hugecsv.csv','columns',2:3,'noheader',true)
using smaller test csv file, printed out this:
c2 = 439105 439105 439105 439105 1836139 1464748 1464748 c3 = '1053224' '1696241' '580064' '1464748' 'external' '439105' '1053224'
which want. however, when actual file of 948739 lines, list of numbers, looks this:
439105 439105 439105 439105 1836139 1464748 1464748 1464748 1464748 580064 580064 580064 580064 1053224
and goes on quite while...
so doing wrong when calling csvimport? can't figure out... appreciated, thank you!!!
Comments
Post a Comment