Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Store csv into qvd

Hi All


I want to store my existing csv file format to qvd format. I have five 10 csv files. Daily i will upload this 10 csv files into my dashboard. How to achieve this?

Thanks in Advance!!

5 Replies
Chanty4u
MVP
MVP

hi,

for each vFile in FileList('*.csv')

     let vQVD = replace(vFile, '.csv', '.qvd');


     if alt(FileSize('$(vQVD)'), 0) = 0 then

          NextFile:

          LOAD

              *

          FROM $(vFile)

          ([... CSV format in here ...])

          ;


          STORE NextFile INTO $(vQVD) (qvd);


          DROP TABLE NextFile;

     end if

Anonymous
Not applicable
Author

You can load CSV files as many as required..

If you are talking about just creating QVD, it is one time activity, like

set Path='C:\Documents';    Path for storing QVDS

CSV_File1:

Load

*

From CSV_File1;

store CSV_File1 into $(Path)\CSV_File1.qvd;   //This statement will create a QVD of File 1

Anonymous
Not applicable
Author

In the same way you can replicate it for multiple CSV files...

Hope this will help!!

tamilarasu
Champion
Champion

Hi Jack,

Try,

sub ScanFolder(Root)

for each FileExtension in 'csv'

   for each FoundFile in filelist( Root & '\*.' & FileExtension)

Let FileName = Replace(subfield('$(FoundFile)','\',SubStringCount('$(FoundFile)','\')+1),'.csv','');

Data:

LOAD *

FROM

[$(FoundFile)]

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

STORE Data into $(FileName).qvd;

Drop table Data;

   next FoundFile

next FileExtension

end sub

Call ScanFolder('C:\Users\Tamilarasu.Nagaraj\Desktop\New folder (2)') ;

Change the file path in last line (Call ScanFolder(Your File Path)).

All csv files will be stored as qvd filefromat with the csv file name.

Not applicable
Author

Hi Jack,

Follow the steps:

1. Load your csv file.

2. Say your file name is ABC.csv,

in  edit script write:


Data:

Load *

from [<your path>\*.csv]

STORE Data into [<your path>\Data.qvd](qvd) ;

If you want to add the new data to the existing qvd then go for incremental load.

Incremental reload and store into QVD file

Regards,

Anjali Gupta