[AccessD] Rename files

Bobby Heid bheid at sc.rr.com
Wed Feb 7 05:43:43 CST 2007


Darren,

As you read each file name, split it up into the file name and the
extension.  Then 

NewName="Inv03" & FileName & "-016." & FileExt 

Then rename the file to NewName.

Bobby

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK
Sent: Wednesday, February 07, 2007 6:30 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Rename files

Hi All

 

I have a renaming routine but can't quite work out the syntax

 

I have file names in a folder similar to

 

10.pdf

11.pdf

12.pdf 

13.pdf

etc etc (All sequential)

 

I want to prefix each file name in the nominated folder with "inv103"

 

I can do this bit - no prob

 

But I want to insert "-016" before the .PDF bit

 

So final filename is like.

inv10310-016.pdf

inv10311-016.pdf

inv10312-016.pdf

inv10313-016.pdf

 

and so on

 

Any suggestions?

 

Many thanks in advance

 

Darren





More information about the AccessD mailing list