Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two script below. That read one folder imported and another exported.
I would like to update the imported table. Records that belong...
//Reading imported folder
For each vFileName in Filelist ('C:\Geral\importados\*.csv')
importados:
Load
KeepChar(@1, '0123456789000') as ID,
KeepChar (@3,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijlmnopqrstuvxzwyéÉúÚâÂÇçõÔÁáÔô/-ãóÓ ') as NomeReal,
'$(vFileName)' as NomeArquivoImportados
From [$(vFileName)]
(txt, utf8, no labels, delimiter is ',', no quotes, header is 1 lines);
Next vFileName;
// Reading exported folder
For each vFileName in Filelist ('C:\Geral\exportados\*.csv')
exportados:
Load
KeepChar( @3, '0123456789000') as ID,
@1 as NomeReal,
'$(vFileName)' as NomeArquivoEnviados
From [$(vFileName)]
(txt, utf8, no labels, delimiter is ',', no quotes, header is 1 lines);
Next vFileName;
How I would like it to be!
table importados
id | NomeReal | exportados | |
1 | a | a | |
2 | b | ||
3 | c |
table exportados:
id | NomeReal |
1 | a |
@Ribeiro try below
//Reading imported folder
For each vFileName in Filelist ('C:\Geral\importados\*.csv')
importados:
Load
KeepChar(@1, '0123456789000') as ID,
KeepChar (@3,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijlmnopqrstuvxzwyéÉúÚâÂÇçõÔÁáÔô/-ãóÓ ') as NomeReal,
'$(vFileName)' as NomeArquivoImportados
From [$(vFileName)]
(txt, utf8, no labels, delimiter is ',', no quotes, header is 1 lines);
Next vFileName;
// Reading exported folder
For each vFileName in Filelist ('C:\Geral\exportados\*.csv')
exportados:
Load
KeepChar( @3, '0123456789000') as ID,
@1 as NomeReal,
'$(vFileName)' as NomeArquivoEnviados
From [$(vFileName)]
(txt, utf8, no labels, delimiter is ',', no quotes, header is 1 lines);
Next vFileName;
left join(importados)
load distinct ID,
NomeReal as exportados
resident exportados;
@Ribeiro try below
//Reading imported folder
For each vFileName in Filelist ('C:\Geral\importados\*.csv')
importados:
Load
KeepChar(@1, '0123456789000') as ID,
KeepChar (@3,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijlmnopqrstuvxzwyéÉúÚâÂÇçõÔÁáÔô/-ãóÓ ') as NomeReal,
'$(vFileName)' as NomeArquivoImportados
From [$(vFileName)]
(txt, utf8, no labels, delimiter is ',', no quotes, header is 1 lines);
Next vFileName;
// Reading exported folder
For each vFileName in Filelist ('C:\Geral\exportados\*.csv')
exportados:
Load
KeepChar( @3, '0123456789000') as ID,
@1 as NomeReal,
'$(vFileName)' as NomeArquivoEnviados
From [$(vFileName)]
(txt, utf8, no labels, delimiter is ',', no quotes, header is 1 lines);
Next vFileName;
left join(importados)
load distinct ID,
NomeReal as exportados
resident exportados;
😀Thank you very much