Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a directory in which text files are there. I have to convert all the .txt files into .qvd files with same name.
It may be possible that for the same .txt , there may be a .qvd file already existist i.e. a.text and a.qvd.
So my requirement is to ignore all the text files which already have been converted into qvds and convert the remaining txt files into qvds.
I tried the below mentioned code but getting a script line error.
DIRECTORY W:\CV Scorecards\Scorecard_Simplification\Working DND\DATA\EXTRACTS\Testing;
FOR Each File in filelist ('*VSS_POS_TRANSACTION.txt')
Let vFile=right('$(File)',len('$(File)')-len('$(vRoot)')-1);
let vQvd = replace('$(vFile)','.txt', '.qvd');
LET vListqvdexists=isnull(QvdCreateTime($(vQvd)));
If $(vListqvdexists)= -1 then
Data:
LOAD *
FROM $(File)
(txt, utf8, embedded labels, delimiter is '~', no eof);
store Data into '$(vQvd)'(qvd);
Drop Table Data;
Next File;
Please help in this regard.
TIA
There is no Endif and some of small changes (Single quotes in vQvd)
Try the below code
DIRECTORY W:\CV Scorecards\Scorecard_Simplification\Working DND\DATA\EXTRACTS\Testing;
FOR Each File in FileList('*.txt')
//Let vFile=right('$(File)',len('$(File)')-len('$(vRoot)')-1);
let vQvd = replace(File,'.txt', '.qvd');
LET vListqvdexists=isnull(QvdCreateTime('$(vQvd)'));
If $(vListqvdexists)= -1 then
Data:
LOAD *
FROM $(File)
(txt, utf8, embedded labels, delimiter is '~', no eof);
store Data into '$(vQvd)'(qvd);
Drop Table Data;
ENDIF
Next File
There is no Endif and some of small changes (Single quotes in vQvd)
Try the below code
DIRECTORY W:\CV Scorecards\Scorecard_Simplification\Working DND\DATA\EXTRACTS\Testing;
FOR Each File in FileList('*.txt')
//Let vFile=right('$(File)',len('$(File)')-len('$(vRoot)')-1);
let vQvd = replace(File,'.txt', '.qvd');
LET vListqvdexists=isnull(QvdCreateTime('$(vQvd)'));
If $(vListqvdexists)= -1 then
Data:
LOAD *
FROM $(File)
(txt, utf8, embedded labels, delimiter is '~', no eof);
store Data into '$(vQvd)'(qvd);
Drop Table Data;
ENDIF
Next File
Thanks Setu...
It is working.