| View previous topic :: View next topic |
| Author |
Message |
PHF
Joined: 16 Sep 2008 Posts: 3
|
Posted: Tue Sep 16, 2008 7:19 am Post subject: extract part of a filename to create a folder |
|
|
Hi,
from a FTP server, I receive files named :
PS_485_CANCAD.csv
or
PT_245_TRANSD.csv
I need to copy the first file in a subfolder named "485"
and the second in a subfolder "245"
(these two subfolders always exist before copying and present in the same main folder).
Can someone help me ?
Thx
(I'm using Automize Pro 7.32) |
|
| Back to top |
|
 |
melvin Site Admin
Joined: 25 May 2006 Posts: 596 Location: Santa Barbara, california
|
Posted: Tue Sep 16, 2008 6:20 pm Post subject: |
|
|
can you hardcode in 485 or 245 into a file monitor task?
if yes, then use one file monitor task and check for the '485' in the filename. if it passes this check, run a copy task to move it into the 485 subfolder.
similarly for the 245 filename.
However, if the filename is PS_AAA_CANCAD.csv where AAA continuously varies, then you have to use a Script task to detect AAA and transfer the file to the appropriate AAA folder. is this the case? |
|
| Back to top |
|
 |
PHF
Joined: 16 Sep 2008 Posts: 3
|
Posted: Thu Sep 18, 2008 12:59 am Post subject: |
|
|
Melvin,
This is the case, AAA varies every week.
Can you tell me where I can find samples of script task to do that ?
Thx |
|
| Back to top |
|
 |
Robert Site Admin
Joined: 25 May 2006 Posts: 1140
|
Posted: Fri Sep 19, 2008 3:59 pm Post subject: |
|
|
| there are script examples via the script task interface. We will write a simple script out here to trim the variable next week. remind us if we forget. |
|
| Back to top |
|
 |
PHF
Joined: 16 Sep 2008 Posts: 3
|
Posted: Tue Oct 07, 2008 6:14 am Post subject: |
|
|
Hi all,
I've found what i needed.
I created a VBScript using a split command to separate different part of filename (with "_" character). then, I build the destination path with all parts extracted.
thanx |
|
| Back to top |
|
 |
|