Renaming a long file name

Post any Bulk Rename Command support requirements here. Open to all registered users.

Renaming a long file name

Postby Fonz » Tue Jul 03, 2012 1:35 am

Hi
I am new to BRC and would like help with the following (Syntax please showing the order of execution rather than a description)

I have a folder C:\Client Registration\Excel Files

There are lots of XLSX and PDF files in this folder and I want to change/rename ONLY the XLSX files in the folder.

Here is a few typical file names and what I would like then renamed to:
" AD106 MOTOR INDUSTRY (PVT) LIMITED) - 123456789 INVOICE 2012-06-30.xlsx"
" AD3 LIBERTY MOTOR INSURANCE GROUP - 123654987 INVOICE 2012-06-25.xlsx"
(all names above are fictitious)

--> file should be rename AD106.xlsx, AD3.xlsx...etc.

What I am trying to do is extract the first part of the name (like AD106 OR AD3 - it is not a fixed number of characters ) which is a code and trim all spaces from it whilst keeping the same XLSX extension - remember this folder also contains PDFs which may or may not have the same file name and I want to ONLY rename the xlsx files.

Thanks for any help given.
Regards
Fonz
Fonz
 
Posts: 1
Joined: Tue Jul 03, 2012 12:51 am

Re: Renaming a long file name

Postby Stefan » Thu Aug 02, 2012 7:40 pm

Fonz wrote:Hi
I am new to BRC and would like help with the following (Syntax please showing the order of execution rather than a description)

I have a folder C:\Client Registration\Excel Files

There are lots of XLSX and PDF files in this folder and I want to change/rename ONLY the XLSX files in the folder.

Here is a few typical file names and what I would like then renamed to:
" AD106 MOTOR INDUSTRY (PVT) LIMITED) - 123456789 INVOICE 2012-06-30.xlsx"
" AD3 LIBERTY MOTOR INSURANCE GROUP - 123654987 INVOICE 2012-06-25.xlsx"
(all names above are fictitious)

--> file should be rename AD106.xlsx, AD3.xlsx...etc.

What I am trying to do is extract the first part of the name (like AD106 OR AD3 - it is not a fixed number of characters ) which is a code and trim all spaces from it whilst keeping the same XLSX extension - remember this folder also contains PDFs which may or may not have the same file name and I want to ONLY rename the xlsx files.

Thanks for any help given.
Regards
Fonz




>> I want to ONLY rename the xlsx files.
use /PATTERN:"*.xlsx"

Note: i think BRC is case sensitive here and don't work on e.g. *.XLSX with that pattern.


- - -

FROM:
"AD106 MOTOR INDUSTRY (PVT) LIMITED) - 123456789 INVOICE 2012-06-30.xlsx"
"AD3 LIBERTY MOTOR INSURANCE GROUP - 123654987 INVOICE 2012-06-25.xlsx"

TO:
AD106.xlsx
AD3.xlsx

I think it's not possible with BRC since there is no RegEx support included:
FInd: (.+?) .*
Replace: \

.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU


Return to BRC Support