Special Bulk Replace

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

Special Bulk Replace

Postby martinca » Mon Jul 22, 2013 4:04 pm

So i found a situation that is a little bit complex (at least for me!).

I have a bunch of files created by a system that cannot offer the final file names, therefore I need to rename them before they can go to the last distribution point. All files come out as:
FOLDER NAME: full_filename
>full_filename.abc
>full_filename_1.abc
>full_filename_2.abc
>full_filename_3.abc
>full_filename_4.abc
>full_filename_5.abc
>full_filename_6.abc
>full_filename_7.abc
>full_filename_8.abc
>full_filename_9.abc

I need to replace _# with some constant information, at the end of the process the files should look like this:
FOLDER NAME: full_filename
>full_filename_200.abc
>full_filename_400.abc
>full_filename_450.abc
>full_filename_750.abc
>full_filename_1200.abc
>full_filename_1700.abc
>full_filename_2200.abc
>full_filename_3500.abc
>full_filename_5000.abc
>full_filename_6500.abc

I can see how the_# files can be easily replaced, however what if one of the original file names contains a _1, wouldn't that get replaced as well? What about the one that doesn't have _#? SInce the rename will be consistent I would like to bulk rename any files, i would just need to run the tool or a command line every time.

Any ideas would be greatly appreciated
martinca
 
Posts: 1
Joined: Mon Jul 22, 2013 3:40 pm

Re-order files as added to folder

Postby truth » Tue Aug 13, 2013 9:34 am

OrigName questions for SystemThatCantCreateFinalNames:
Does it only create filenames in batches of xx or less, then fail until those filenames no longer exist?
What is the max _# appendage it can create: _9, _99, _999?
Once those files get renamed, will STCCFN resume creating the same filenames as it did originally?
Are there any files that should never get renamed? (to distinguish them from full_filename.abc)

FinalName questions:
Why do appendages start at 200, & then increase with varying increments?

Without knowing the details, its hard to be specific
It seems like just sorting by create-date & numbering would suffice, an ex:
brc32 /pattern:*.abc /sortby:c /sortdesc /regexp:"(.*)(_\d{1,})$:\1" /autonumber:1:1:S:_:10:3

That sorts *.abc by create-date, removes all pre-assigned appendages (not changing their order),
& then re-appends ALL *.abc's with _# in-order by create-date (padded to 3 digits if you want)
You would first need to ensure that STCCFN sets your create-dates as needed
Another issue could be having .abc's that should never get appended?

To answer your concerns: yes, it only affects _# at the end of a filename($)
It also handles any full_filename.abc(no-appendage) as expected since it matches *.abc
If for some reason you cant go by date, there are more options, but they depend on your conditions
Post back if you need anything further
truth
 
Posts: 221
Joined: Tue Jun 25, 2013 3:39 am
Location: Earth, OrionArm, MilkyWay


Return to BRC Support