Discussion Board for collaboration related to QlikView App Development.
i want to read all the .txt file from a folders (sub dir included) and i use the following script
sub DoDir (Root) for each File in filelist (Root&'\*.' &'TXT') lista_fisiere: Load '$(File)' as path autogenerate 1; next Filefor each Dir in dirlist (Root&'\*' ) call DoDir (Dir)next Dirend sub
The script works fine till encounters one folder or txt files which contains quote character ( ' ) in the name.
Anyone know a workaround?
You could use purgechar function to remove them
I cant use PurgeChar because based on the name of the file i need to load that folder or not.
have a batch file that renames the files prior to reload?
not a possible solution because those file are used by other application also
Use nested FOR loops . The quote will get escaped == will appear twice in the loaded field. Works in QV9 64 bits, and QV10 32 bits.
for each Dir in dirlist (Root&'\*' ) for each File in filelist (Dir &'\*.' &'TXT') lista_fisiere: Load '$(File)' as path autogenerate 1; txt: LOAD @1 as txt FROM [$(File)] (txt, codepage is 1252, no labels, delimiter is '\t', msq); nextnext