I am currently reading data from a series of remotely generated QVD files. The QVD files are regenerated frequently with randomized file names. As a stopgap, I am currently modifying the file name by hand in the LOAD statement of my script each time I want to rerun the script, but obviously, this is rather tedious. I would like to instead use a File Dialog box to select the filename and then dynamically use that filename in my LOAD statement. I can't find any discussion on how to do this. Is it possible?
Does the whole file name change, each and every time?
Or just part of the file name changes?(eg:just like filename ABC-timestamp, ABC remains same but timestamp changes)
If the whole filename changes each and every time, we can do nothing except changing the file name in the script over and over but if its just the part of the file name that changes each time then probably u could have solution to that by using some variables and loopin script to check the existance of the file.
Not as far as I know. But perhaps there's another way. How do you know which of the randomly named qvd files you want to load?
It's enough to use an Input Box during script load?
Let vDate = Input('Enter Start Date (MM/DD/YYYY)' , 'Input required');
and then use this variable to build qvd name
Bye
Yes, at the time of when i am ready to load, I know the file name. But it is a bit tiresome to enter the filename manually into the script, especially when a file select dialog to assign the filename to a variable seems like it should be a straightforward bit of functionality.
Hi Lyon,
i don't know if there's a way of generating a file dialog, but i did something similar by having your script first load a csv with the file list. This CSV was in a folder reachable to the user and they filled it everytime with the files to load.
Hope this helps.
Kind regards,
Does the whole file name change, each and every time?
Or just part of the file name changes?(eg:just like filename ABC-timestamp, ABC remains same but timestamp changes)
If the whole filename changes each and every time, we can do nothing except changing the file name in the script over and over but if its just the part of the file name that changes each time then probably u could have solution to that by using some variables and loopin script to check the existance of the file.
Yes, at the time of when i am ready to load, I know the file name.
How?
Oh, now I understand the question. I don't know the filename for any intrinsic reason - I am usually just checking the file directory, finding the file name (usually the most recent set of file, but there can be exceptions, which can make automation difficult), and then copying it into the script.
As another poster asked, the difference in the file name is a timestamp, so it is actually not randomized, but as sometime multiple files are generated, some of which need to be ignored, I was a bit worried about trying to overly automate the file selection process.
The difference in the file name is a timestamp, so it is actually not randomized, but as sometime multiple files are generated, some of which need to be ignored, I was a bit worried about trying to overly automate the file selection process
If a file dialog box is not an option, this might be the best way for me to do it. I can automate it to an extent, but still make changes when there are anomalies in the file listings.