Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a huge QVD file that I would like to split equally between X CSV files
Any idea how can I do it if the amount of records doesn't know?
@shahafei2 if you have a rowno() or keyID in you datasource you can use the script below, if not you have to add it in your qvd file before the script like ;
Data:
LOAD
RowNo() AS RowNum,
*
FROM DataSource;
to know the no of records in your QVD you can use QvdNoOfRecords ('Data.qvd')
suppose you want to plit the qvd to 10 csv file,the scipt :
LET vRowsPerFile = QvdNoOfRecords ('Data.qvd')/10;
LET vRowCount =QvdNoOfRecords ('Data.qvd');
LET vNoOfPages = Ceil(vRowCount/vRowsPerFile);
LET vRowStartNum = 1;
For Index = 1 to vNoOfPages
LET vRowEndNum = vRowsPerFile * Index;
Temp:
NoConcatenate
LOAD
*
RESIDENT Data
WHERE RowNum >= $(vRowStartNum) AND RowNum <=$(vRowEndNum);
STORE Temp INTO File$(Index).qvd;
@shahafei2 if you have a rowno() or keyID in you datasource you can use the script below, if not you have to add it in your qvd file before the script like ;
Data:
LOAD
RowNo() AS RowNum,
*
FROM DataSource;
to know the no of records in your QVD you can use QvdNoOfRecords ('Data.qvd')
suppose you want to plit the qvd to 10 csv file,the scipt :
LET vRowsPerFile = QvdNoOfRecords ('Data.qvd')/10;
LET vRowCount =QvdNoOfRecords ('Data.qvd');
LET vNoOfPages = Ceil(vRowCount/vRowsPerFile);
LET vRowStartNum = 1;
For Index = 1 to vNoOfPages
LET vRowEndNum = vRowsPerFile * Index;
Temp:
NoConcatenate
LOAD
*
RESIDENT Data
WHERE RowNum >= $(vRowStartNum) AND RowNum <=$(vRowEndNum);
STORE Temp INTO File$(Index).qvd;
Thanks ill try it
Thanks a lot
it's worked like a magic