Bonjour,
J'ai différent fichiers CSV sous le format suivant :
20181112-product-extract
20180911-product-extract.csv
20181212-product-extract.csv
Je souhaiterai charger uniquement le dernier fichier CSV.
J'ai essayé d'écrire le script suivant :
LET vFilePath = 'lib://AttachedFiles/*-product-extract.csv';
FOR EACH file in FileList('$(vFilePath)'); // Loops each excel file in the given Folder
LET vFileDate = Date((Left(file,8)); // Gets the year portion from the filename
LET vMaxDate = Rangemax(vFileDate, vMaxDate); // Gets the max year for every iteration
NEXT
Data:
LOAD sku
FROM [lib://AttachedFiles/$(vMaxDate)-product-extract.csv]
(txt, utf8, embedded labels, delimiter is '|', msq);
Mais j'ai l'erreur suivante : "Cannot open file 'lib://AttachedFiles/-product-extract.csv'
Merci d'avance 🙂