hiteksoftware.com Forum Index hiteksoftware.com
User discussion forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

extract part of a filename to create a folder

 
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Variables and Regular Expressions
View previous topic :: View next topic  
Author Message
PHF



Joined: 16 Sep 2008
Posts: 3

PostPosted: Tue Sep 16, 2008 7:19 am    Post subject: extract part of a filename to create a folder Reply with quote

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
View user's profile Send private message
melvin
Site Admin


Joined: 25 May 2006
Posts: 596
Location: Santa Barbara, california

PostPosted: Tue Sep 16, 2008 6:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
PHF



Joined: 16 Sep 2008
Posts: 3

PostPosted: Thu Sep 18, 2008 12:59 am    Post subject: Reply with quote

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
View user's profile Send private message
Robert
Site Admin


Joined: 25 May 2006
Posts: 1140

PostPosted: Fri Sep 19, 2008 3:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
PHF



Joined: 16 Sep 2008
Posts: 3

PostPosted: Tue Oct 07, 2008 6:14 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Variables and Regular Expressions All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group