T O P I C R E V I E W |
Mulvenna |
Posted - 10/18/2013 : 09:00:58 AM Origin Ver. 8.6 Operating System: Windows 7
Hi,
I was hoping someone could help me. At the minute I have a script that outputs pdf files to one folder. These graphs are then manually moved to the neccessary folders. I want to automate the entire process but here's my problem. The folders are named in order:
TR0001 | | TR9999
but they all have text after the reference number:
TR2015 - "BlaBla This text is never the same"
For each output, Origin can find the reference number from the information it is given but not this extra text. Is there any way I can get the files to go to the correct folder without knowing this information???
Basically, I can get origin to find the entire directory except the middle, highlighted part:
\\Ihitesting\twi_data\testing\TR_____\Testing Request TR2001 - TR2200\TR2015_M274_115kW_WL-LLK_PPAP Performance_PT1\data\post processing\01_Technology_Testing\TR2015_TC01
Any help at all would be great. Thanks! |
2 L A T E S T R E P L I E S (Newest First) |
Mulvenna |
Posted - 10/21/2013 : 03:42:07 AM Thanks Greg! That worked perfectly.
What I meant was, in my script, I was using information from the imported ASCII file to compile a file path from various strings (Not a very elegant way of doing it). I didn't realise there was a command to get folder names.
Thanks again, great help! |
greg |
Posted - 10/18/2013 : 2:54:36 PM I don't know what you mean when you say you can "get origin to find the entire directory except the middle .. part"
Here is a script that finds all the folders in the "Testing Request TR2001 - TR2200" folder and parses the different parts of the folder names:
findfolders path:="\\Ihitesting\twi_data\testing\TR_____\Testing Request TR2001 - TR2200"; loop(ii,1,folder.GetNumTokens(CRLF)) { fld$ = folder.GetToken(ii,CRLF)$; ty Found folder %(fld$); ty -l Folder parts :; loop(jj,1,fld.GetNumTokens("_")) { str$ = fld.GetToken(jj,"_")$; ty -l %(str$)\t; } ty; }
Given a folder, you can also get all the files in that folder as in: findfiles path:="\\Ihitesting\twi_data\testing\TR_____\Testing Request TR2001 - TR2200\TR2015_M274_115kW_WL-LLK_PPAP Performance_PT1\data\post processing\01_Technology_Testing\TR2015_TC01" ext:="*.*"; loop(ii,1,fname.GetNumTokens(CRLF)) { file$ = fname.GetToken(ii,CRLF)$; ty -v Found file %(file$); }
|
|
|