Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
in the editor i try to extract only files csv that doesn't contain the word 'ElencoFlussi', but it fails: what can I do?
Regards.
PDR_STG1:
LOAD
Piva_Udb&'|'&Cod_Remi&'|'&Cod_prof_prel_std&'|'&Trattamento&'|'&Annomese&'|'&pdr as key,
pdr&'|'&Annomese as key_flussi,
pdr,
Prelievo,
Piva_Udb,
Dtg,
Cod_Remi,
Id_regione_climatica,
Cod_prof_prel_std,
Trattamento,
Tipo_cliente,
Sessione,
Annomese,
filename() as NomeFile
FROM [lib://SCR_Shared_Folder/Dettaglio PDR - Flussi/*.csv]
(txt, codepage is 28591, embedded labels, delimiter is ';', msq)
where not WildMatch(filename(), 'ElencoFlussi');
exit script;
I think you mean this:
for each file in filelist('path\*.csv')
if not wildmatch('$(file)', '*xyz*') then
t: load * from [$(file)] (txt, ...);
end if
next
- Marcus
Hello,
Try below,
where not WildMatch(filename(), '*ElencoFlussi*');
Thanks,
Ashutosh
I'm not sure if you could use filename() on the outside of a load - means it's probably empty or NULL.
More suitable within the many scenarios is the use of filelist() instead of your wildcard-load - means something like:
for each file in filelist('path\*.csv')
if not wildmatch('$(file)', '*xyz*') then
... load ...
end if
next
- Marcus
I think you mean this:
for each file in filelist('path\*.csv')
if not wildmatch('$(file)', '*xyz*') then
t: load * from [$(file)] (txt, ...);
end if
next
- Marcus
You use it really like above suggested with load * from [$(file)] and replacing xyz with your string? You may also adjust a bit the condition from:
if not wildmatch('$(file)', '*xyz*') then
to
if wildmatch('$(file)', '*xyz*') = 0 then
- Marcus
Code give above worked for me,, made it more simplified ,try it.Hope it works for you
for each file in filelist('MENTION PATH HERE\*.csv')
if not wildmatch('$(file)', '*Elenco Flussi*') then
t: load * from [$(file)] (txt);
end if
next