Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
This code fragment is designed to load multiple csv files of a pattern *XBWDO603* from a list of subfolders. It is happy to load numeric folders e.g. 20110711, 20110718 but generates an error "Syntax error, missing/misplaced FROM" with folder 20110705R. Rename the folder to be numeric 20110705 and the code works.
Anyone got an idea why this might be ? I am using QV v9.00.7778.9 SR7 x64 ....
// Set the current directory
directory 'c:\data';
// bluefile folders to load
set FolderScope = '20110705R','20110711','20110718','20110725','20110801';
FOR each FilePath in $(FolderScope);
LOAD $(FilePath) & '\' & filename() as source,
@1, @2, @3, @4 as @4, @5, @6, @7, @8, @9, @10, @11, @12, @13, @14, @15,
left(@8,4) as year, mid(@8,5,2) as month,
@2 & @3 & @4 & @5 & @6 & @7 & @8 & @9 & @10 & @11 as unikey,
if(@4='0012077225','DIRECT','NORMAL') as channel
FROM [$(FilePath)\*XBWDO603*] (txt, codepage is 1252, no labels, delimiter is '|', msq);
NEXT FilePath;
Try wrapping $(Filepath) with single quotes in first line of LOAD
So:
LOAD '$(FilePath)' & '\' & filename() as source,
.....
Try wrapping $(Filepath) with single quotes in first line of LOAD
So:
LOAD '$(FilePath)' & '\' & filename() as source,
.....
Thanks Rakesh and apologies for the late reply to your correct answer, this worked !
thnx
Ian