Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Day of month and download file placement.

Status
Not open for further replies.

wardb

IS-IT--Management
May 12, 2006
2
US
I retrieve a text file from the bank daily which contains invoice numbers, dollar amounts, etc. An Access application subsequently processes that text file and posts to the appropriate individual's account. I want to use Aspect to place the downloaded text file ( the file name is constant )into a folder on a network drive corresponding to the day number of the month. i.e. today's file would go into folder 12. Actually, a cleaner way to do this would be to rename, or copy the downloaded file to a filename consisting of month,day,and 2 digit year with a .txt extension. ( 051206.txt )
Any help on either method would be greatly appreciated.
Regards,
Ward
 
Try this out..

It takes a file "c:\captest.txt" and renames the file based on your post.
(This is just a modification from the help file.)

Code:
proc main
   integer Month, Day         ; Integers to contain date and
   integer Year, Hour         ; time converted from long
   integer Min, Sec           ; date and time.
   string sYear
   string sTemp
   string NewFName
   string Fname
   
   ; Convert long time value into it's counter parts, year,
   ; month, day, hour, min, and sec.
   ltimeints $LTIME Year Month Day Hour Min Sec
  
   Fname = "c:\captest.txt"
   numtostr Year sTemp
   strright sYear sTemp 2
   strfmt NewFName "c:\%02d%02d%02s.txt" Month Day sYear
   
   
   
   rename Fname NewFName
endproc
 
Sorry for taking so long to get back with you. I tried this after you kindly posted it, and it works great. Exactly what I needed it to do after making a couple of changes to filenames, paths, etc.
Thank you very much for your help.
Regards,
Ward
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top