T O P I C R E V I E W |
queryforum |
Posted - 09/17/2012 : 09:37:46 AM Origin Ver. and Service Release (Select Help-->About Origin): 8.5.1 Operating System: WinXP
Hello, I need your held with this. I have created an Import Filter in Origin (.oif). Now i want to create a custom menu button that prompts me to open a .dat file and automatically uses the .oif File to take out the relevant data. As you may know I need the "Labtalk script" for this
something like this:
getfile:"Ask for path"; impfile fn:="path" fi:="D:\ASCII_Import.oif";
would be great if this works for multiple files! |
1 L A T E S T R E P L I E S (Newest First) |
greg |
Posted - 09/17/2012 : 2:30:16 PM Your impfile should work fine, so your real question is importing MULTIPLE files.
Here is some code that imports files found in ..\Samples\Import and Export:
// BEGIN SCRIPT dlgfile gr:=ASCII mu:=1; // browse to Samples\Import and Export loop(ii,1,fname.GetNumTokens(CRLF)) { file$ = fname.GetToken(ii,CRLF)$; impfile fn:=file$ fi:=VarsFromFileNameAndHeader.oif location:=0; } // END SCRIPT The filter file is stored in the same location (location:=0) as the data files: S15-125-03.dat S21-235-07.dat S32-014-04.dat
dlgfile uses the mult-file option (mu:=1) to populate the fname$ variable with multiple lines. fname.GetNumTokens(CRLF) returns the number of files (one per line) fname.GetToken(ii,CRLF)$ returns the next filename. |
|
|