Opening a file with a Wildcard

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
ADP_MAN
Junior Coder
Posts: 45
Joined: Wed Apr 07, 2004 2:04 pm

Opening a file with a Wildcard

Post by ADP_MAN » Wed Sep 10, 2008 8:32 pm

**Note: I think I posted this in an incorrect forum before so I'm posting it here again. Sorry for the double post**

I have a file that needs to be opened and renamed on a daily basis. PART of the filename changes daily so I want to open the file using the "*". Here is part of the script I have so far:


I first want to locate the file and see if the file is there. In this case the file name is "ETCTXT02292295P.091008.024310001.txt" The first part of the file name does not change "ETCTXT02292295P." and the second part is the date. The final part of the file name changes daily and it's not something I can determine. When I run IfFileExists using the formula below, it will correctly tell me if the file exists or not. After that is complete I want to open the file and that is where I'm having problems. Any suggestions?

Day>theDay
Month>theMonth
Year>theYear
//GET LAST TWO DIGITS OF YEAR
MidStr>theYear,3,2,theYear

//DETERMINE YEAR
ifFileExists>T:\IQ\DATA\COMM\outbound\outbound\ETCTXT02292295P.%theMonth%%theDay%%theYear%*,Open

Label>Open
ExecuteFile>T:\IQ\DATA\COMM\outbound\outbound\ETCTXT02292295P.%theMonth%%theDay%08*

Thanks in advance,
Dominic

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Sep 10, 2008 8:42 pm

Use GetFileList. See my reply to your duplicate post.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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