function convert_to_history(string filename)
{
string InName = strf("D:\\Quotes\\Brasil\\DI\\%s",filename);
if(!InName) return quit("No file");
int Records = dataParse(1,Format,InName);
printf("\n%d lines read",Records);
string OutName = strx(InName,".csv",".t6");
if(Records) dataSave(1,OutName);
printf("\n%s",OutName);
}
function main()
{
Verbose = 7;
string file = file_next("D:\\Quotes\\Brasil\\DI\\*.csv"); // DIR WHERE THE FILES ARE
while(true)
{
convert_to_history(file);
dataNew(1,0,0);
file = file_next(0);
if(file == 0 || file == "0")
break;
}
quit("done");
}