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

Qvd Creation in a directory

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

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

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

View solution in original post

2 Replies
settu_periasamy
Master III
Master III

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

Not applicable
Author

Thanks Setu...

It is working.