I'm parsing CSV file with tick data with the script:

string Format = "f,f,i";
void main()
{
int N,Row,Record,Records;
Records = dataParse(1,Format,FileName); // read BBO data

printf("n%d rows read",Records);

dataNew(2,Records,2); // create T1 dataset

for(Record = 0,Row = 0; Record < Records; Record++)
{
T1* t1 = dataStr(2,Row,0); // store record in T1 format
t1->fVal = dataVar(1,Record,2);
t1->time = dataVar(1,Record,1)/86400+25569;
Row++;
}
printf(", %d stored",Row);
dataAppend(3,2,0,Row); // append dataset
if(!wait(0)) return;

dataSave(3,OutName); // store complete dataset
}

The result: 8876715 rows read, 887615 stored. I checked with ZHistoryEditor that it is fine.
However Zorro prints Error 016: Incosistent start/end dates.


In manual about dataparse:

The CSV file can be in ascending or descending chronological order, but the resulting dataset should be always in descending order, i.e. the newest records are at the begin.

So the right order should be done automaticly.
However I see the problem.

Shoud I sort the records before saving to .t1 file?

Last edited by Hlopetz; 07/31/17 18:38.