Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
martyn_birzys
Creator
Creator

Looping through files using DocumentPath()

I am trying to loop through 3 .qvd files in QVDs subfolder, but all I'm getting is blank screen (empty table).

LET vPath = Replace (DocumentPath (), '\' & DocumentName (), '')&'\QVDs';

FOR Each File in filelist ($(vPath))

fileTable:

LOAD

'$(File)' as Name,

FileSize( '$(File)' ) as Size,

FileTime( '$(File)' ) as FileTime

autogenerate 1;

TRACE folderpath-- $(vPath) . filename-- $(File);

NEXT File

1 Solution

Accepted Solutions
maxgro
MVP
MVP

LET vPath = Replace (DocumentPath (), '\' & DocumentName (), '')&'\QVDs';

trace $(vPath);

FOR Each File in filelist ('$(vPath)\*.*')

  trace $(File);

  fileTable:

  LOAD '$(File)' as Name,

  FileSize( '$(File)' ) as Size,

  FileTime( '$(File)' ) as FileTime

  autogenerate 1;

  TRACE folderpath-- $(vPath) . filename-- $(File); 

NEXT File

View solution in original post

2 Replies
maxgro
MVP
MVP

LET vPath = Replace (DocumentPath (), '\' & DocumentName (), '')&'\QVDs';

trace $(vPath);

FOR Each File in filelist ('$(vPath)\*.*')

  trace $(File);

  fileTable:

  LOAD '$(File)' as Name,

  FileSize( '$(File)' ) as Size,

  FileTime( '$(File)' ) as FileTime

  autogenerate 1;

  TRACE folderpath-- $(vPath) . filename-- $(File); 

NEXT File

martyn_birzys
Creator
Creator
Author

Tried this syntax too, I was only missing the single quotes. It looks wrong at the beginning - the script editor does not recognize the variable inside quotation marks. But it works, thanks for that.