Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Runo_ooa
Contributor
Contributor

Detecting FileNames

Hello all,

 

I have txt files around more than 500, but some of them are empty 😕 , can i reveal which of them are empty txt files? i done something like that but couldnt achive it

 

Set Error Mode = 0;

LOAD

a,

b,

c

FROM [lib://folder/*.txt]

if  ScriptError = 11 then

Load 

filename() as EmptyTxt

autogenerate 1;

 

 

1 Reply
Miguel_Angel_Baeyens
Support
Support

What about something like:

Files: // only the header
LOAD * INLINE [
FileName
];

FOR EACH vFile in FileList([LIB://Folder/*.txt])

  CONCATENATE (Files)
  '$(vFile)' AS FileName
  AUTOGENERATE 1;

NEXT vFile

And then repeate a FOR loop using the "Files" table.