<< Click to Display Table of Contents >> Navigation: ThinBASIC Modules > CSV > cCSV class > <cCSV> constructor > <cCSV> properties > <CCSV>.Root |
Description
Increase/Decrease number of pre-allocated rows when loading CSV file during <cCSV>.Load operations.
Syntax
'---SET
<cCSV>.Rows.Buffer = nRows
'---GET
nRows = <cCSV>.Rows.Buffer
Returns
Number, number of pre-allocated rows.
Remarks
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
Restrictions
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
Examples
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}")
waitkey