Jump to content

Recommended Posts

Posted

I'm sorry for asking what I'm sure is a very basic question...

Here's the situation: We have an excel file that's exported monthly and saved in a directory \\reporting\ScoreCard\Scorecards-2008-09-Sep-Fiscal.xls

I need to copy and rename it to \\reporting\Prepfiles\Scorecards.xls

The problem I'm having is in writing a script to copy this from one directory to another with the name changing. I can handle this copy in either DOS through a command batch, or in VBA in the background of an Access project that has a table linked to the \\reporting\Prepfiles\Scorecards.xls file. I've run across several examples where the files are simply named 200809, but how can I translate that into the three character month name?

Any help on this would be greatly appreciated, and again, I'm sorry for what should be a simple answer.


Posted

If I get right your question, you can start from some of the ideas posted here:

http://www.msfn.org/board/Rename-File-With...-Fi-t47812.html

Than, once you have a variable %month% defined as 01, 02, 03, etc., you have to replace 01 with JAN, 02 with FEB, etc.

Since I donìt think you need to take into account the efficiency of the code, a serie of:

IF %month%.==01. SET month=JAN
IF %month%.==02. SET month=FEB
IF %month%.==03. SET month=MAR

should do.

jaclaz

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...