T O P I C R E V I E W |
Clairekun |
Posted - 10/01/2013 : 06:40:28 AM Origin Ver. and Service Release (Select Help-->About Origin): 9 SR2 Operating System: Windows 7
Hello, I would like to know if there's a script for what I need. I would need a script to open files (in the same folder) with similar file name into an XYYY table, for example:
ABC_1.asc ABC_2.asc DEF_1.asc DEF_2.asc DEF_3.asc GHIa.asc GHIb.asc JKL.asc
So, I would like to have 4 different tables: ABC files, DEF files, GHI files and the JKL file, in XYYY format. Please note that not all of them have an underscore to separate them, although I believe I could change that if needed, but all of them do have the first 3 characters unchanged.
I would like to avoid, if possible, writing the names manually; I mean, the script would have to be something along the lines of "files with identical 3 starting characters should be in the same table"
I currently know how to open all files in a folder, both XY and XYYY format, I think I would only need a script to determine that bit about names.
Again, I do not know if such an specific script can exist.
Thank you and sorry for the long post. |
1 L A T E S T R E P L I E S (Newest First) |
greg |
Posted - 10/01/2013 : 5:30:13 PM Maybe this will work the way you want?
dlgfile gr:=*.asc mu:=1; loop(ii,1,fname.GetNumTokens(CRLF)) { strFile$ = fname.GetToken(ii,CRLF)$; strPart$ = strFile.GetFileName()$; strPart$ = strPart.Left(3)$; if(exist(%(strPart$))==2) { win -a %(strPart$); newsheet; impasc fname:=strFile$ options.FileStruct.NumericSeparator:=0 options.Names.FNameToBk:=0; } else { newbook name:=%(strPart$) option:=lsname; impasc fname:=%(strFile$) options.FileStruct.NumericSeparator:=0 options.Names.FNameToBk:=0; } }
|
|
|