Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I have a problem with the following script:
LET vFilePath ='lib://AttachedFiles'; FOR EACH file in FileList('$(vFilePath)/*.csv'); // Loops each excel file in the given Folder LET vFileDate = Date(Left(right(file,28),8)); // Gets the year portion from the filename LET vMaxDate = Rangemax(vFileDate, vMaxDate); // Gets the max year for every iteration NEXT Data: LOAD * FROM [$(vFilePath)/$(vMaxDate)-product-extract.csv] (txt, utf8, embedded labels, delimiter is '|', msq);
The script works very well, that is, it will fetch me the last CSV file on my server.
However, when I change the name of the path where I have to look for the CSV file, I have the following error:
Cannot open file: 'lib://AttachedFiles/20181028-product-extract.csv'
While the new folder contains exactly the same CSV. I feel that my vFilePath variable keeps track of the folder path.
How could I solve that?
Thanks in advance 🙂
When you say "change the name of the path" do you mean you edit the folder in the connection named "AttachedFiles"? Or something else?
-Rob
This doesn't look like a valid connection name.
.....\Approvisionnement Logvad
The .... is sure to confuse the script parser.
-Rob