08-18-2011 04:55 AM
Hi all,
I have a script which takes .dat file as input. Call DataFileLoad(strDataRawPath_, "DAT", "Load")
Now, I modified the string DAT to ANY so that it accepts any file format say .iso, .mme, etc....
But when i try to load the .iso file it pops a msg that particular file doesn't exixts. (I have installed iso plugin)
How can i make my script to accept multiple file formats??
Solved! Go to Solution.
08-18-2011 06:03 AM
Hi,
try to leave the second parameter (FileImportFilter) empty, so DIAdem will try to choose the correct DataPlugin for you to load.
08-19-2011 12:33 AM
Hi usac,
THis is not working for me. I am using the very big script of about 5000 lines in which i have datafileload statement nearly 8 times. I repalced each in each line from DAT to " ". But am getting pop up msg, fle cannot be found. I have attahed both script and test file in same location.
Call DataFileLoad(strDataRawPath_, "DAT ", "Load")
Call DataFileLoad(strDataProPath_ & "_Processed", "DAT", "Load")
Call DataFileLoad(strDataProPath_ & "_Processed", "DAT", "Load")
Call DataFileLoad(strDataProPath_ & "_Processed", "DAT", "Load") to load processed data..
I replaced all DAT with "", but no use.. Can some one suggest me how can i do this??
08-19-2011 01:34 AM
Hi,
sorry for being unclear.
Please try to usethe command as follows:
Call DataFileLoad(strDataRawPath_, , "Load")
Leaving the parameter completely empty is different in contrast to passing an empty string.
Greetings
08-25-2011 04:41 PM
Hi RSH,
Passing the "" parameter will work as well-- either way you're instructing DIAdem to use the DataPlugin associated with the file extension, which is the same thing that happens when you drag&drop from the NAVIGATOR into the Data Portal. I'd be inclined to believe the error message that the script can't find the data file. If you have the script and the data file in the same folder, then you can use the AutoActPath variable to pass the correct folder information to form the full file path, which is ALWAYS a good idea.
Call DataFileLoad(AutoActPath & "FileName.DAT", "", "Load")
Brad Turpin
DIAdem Product Support Engineer
National Instruments
08-29-2011 08:38 AM
Hi Brad,
Am using,
Call FileNameGet("ANY", "FileRead", AutoActPath, "", "", 0, "Select File to Process...")
If DlgState = "IDCancel" Then Call AutoQuit
Call DataFileLoad(AutoActPath & "FileName.DAT", "", "Load")
Am i supposed to use like this?? Fila name get with ANY followed with datafileload...
And the highlighted text in red only loads that particular filename. If i want to load any file with any data format( .mme, .iso, .dat, .egv) , All located in same folder, how do i do that??
Will the above statements still work for this??
Not to confuse you, My idea is to load any file type when i run my script. It should nt be restricted only to .dat or .mme... Provided all scripts and data files in same location...
Many thanks,
RSH
08-30-2011 09:51 AM
Hi RSH,
That's the right approach to load one file of an arbitrary file type, using DIAdem's file extension DataPlugin association list-- the same one you use when you drag&drop from the NAVIGATOR into the Data Portal.
In order to load multiple files from one folder, you'll need to build an array of all those files. I have code to do this that I can send you, but do you really want to try to load ALL files in that folder? What if there are *.doc or *.pdf files in that folder? Isn't there a short list of file extensions that are valid, say *.DAT,*.MME,*TDM,*.TDMS?
Do you just want all the data files on one folder level, or in all the subfolders of that parent folder as well?
Brad Turpin
DIAdem Product Support Engineer
National Instruments
09-06-2011 04:44 AM
Brad,
To be more Clear..
In my C:/> I have Scripts Folder, inside which I have Test DB folder. Like this.
C:\ Scripts \ Test DB
I have my scripts in Scripts Folder. And all test files in (*.iso, *.dat, *.egv file samples).
I want to test my script for all type of test samples. Hence I load any 1 type of file each time.
I will not load all type of files at a time.
Now I can successfully test my scripts to load .dat files. Now If i try to load *.iso (or) *.egv, what I should do??
Should I keep changing my script adding "iso" and ".egv" in datafileload( , , ,) function for each file type??
What is the best way to achieve this??
09-06-2011 07:59 AM
Hi RSH,
There are a variety of ways to address this scenario. In your case I think I'll recommend that you make 2 copies of your VBScript, resulting in one for each file type, and edit them accordingly:
Load All ISO Data Files.VBS
Load All DAT Data Files.VBS
Load All EGV Data Files.VBS
This way you can easily pick which file type to load, and you only have to make the script edits once.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
09-06-2011 11:24 PM
Brad,
Is this the only way to load different files.. Can't i have a single script to load differewnt types of files??
I want to have a single copy of my script.. from which i can load files of different format which I select through the load window..