Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using csv files that are run every day and stored in a folder with the same name but with todays date, so I am trying to just pick the most current date to load ... below is the script I am working with.
LOAD [UCS Domain] as 'CAV CS Domain',
Org as CAVLOB,
[Host Name] as CAVHostName,
[Hardware Status] as CAVHardwareStatus,
[SAN Name] as CAVSANName
FROM
[\san$\SAN-Fabric-Refresh\VSI-Pending-Reboots\AP-HK-Cavendish\hkcdhvsi.pending-reboots.2020-01-31.csv]
(txt, codepage is 28591, embedded labels, delimiter is ',', msq);
May be you can create a script variable that stores the date like vDate = Date(Today(), 'YYYY-MM-DD') and then when you are loading the file you can use this variable.
Something like -
FROM
[\san$\SAN-Fabric-Refresh\VSI-Pending-Reboots\AP-HK-Cavendish\*vDate *.csv]
(txt, codepage is 28591, embedded labels, delimiter is ',', msq);
Thank you I will give this a try!!
Another option might be to create an 'archive' folder where you run an external command in our script to RoboCopy the new file to the archive after you have read it such that you only have to worry about the new single file etc...
Be sure to return to the thread if the other poster's response worked for you, use the Accept as solution button on their post to mark it, otherwise leave an update on things.
Regards,
Brett