Edit file name

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
putmann
Junior Coder
Posts: 24
Joined: Mon Aug 20, 2007 1:15 am
Location: Queens,NY

Edit file name

Post by putmann » Thu Feb 14, 2008 1:49 am

I have a file name where there is random 6 digit number generated daily within text of the file name. I want to copy the file name to a different name, but wildcards won't work because of the random generated number in the file name.

copyfile>T:\DailyDataFiles\ProcessedFiles\LIJ_IP_DAILY_AR_PROCESSED_052005_FIXLENGTH.TXT,\\nasdata02\finance01\DATA\SMS_MC\Projects\_Databases\Archive\C\Cash\Daily CashDB Backup and Test\CashIP.TXT

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Feb 14, 2008 2:15 am

I think that using VB Script RegEx will work for you.

You could use a RegEx to capture something like this:
"T:\DailyDataFiles\ProcessedFiles\LIJ_IP_DAILY_AR_PROCESSED_[0-9]{6}_FIXLENGTH.TXT" and assign it to a variable to be renamed.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

putmann
Junior Coder
Posts: 24
Joined: Mon Aug 20, 2007 1:15 am
Location: Queens,NY

VBScript RegEx

Post by putmann » Thu Feb 14, 2008 2:33 am

Bob, Thanks

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts