<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > CSV > cCSV class > <cCSV> constructor > <cCSV> properties >





Increase/Decrease number of pre-allocated rows when loading CSV file during <cCSV>.Load operations.





<cCSV>.Rows.Buffer = nRows



nRows = <cCSV>.Rows.Buffer




Number, number of pre-allocated rows.




Default rows buffer is 500 rows. It means that every 500 rows, internal data matrix will be reallocated in memory.

Reallocation is very high cpu/memory consumption operation so having the correct pre-allocated number of rows is important.


For CSV files with high number of columns (lets say more than 100) and relatively low number of rows (less than 100k), please decrease this parameter.


For CSV files with low number of columns (less then 100) and high number of rows (up to milions), please increase this parameter in order to reduce number of times internal matrix will be relocated in memory




You need to set buffer before a call to <cCSV>.Load.


Minimum number of rows is 100.

Maximum number of rows is 10000.


See also





uses "CSV""console"


dim data as new cCSV

data.Row.Buffer = 1000


data.Load(APP_ScriptPath + "big.csv"True)  ' Change to existing CSV file


printl $("Number of rows found: {data.Rows}")