Feature request: Batch process to replace predefined strings with other strings in filenames

Discussion related to "Everything" 1.5 Alpha.
Post Reply
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Feature request: Batch process to replace predefined strings with other strings in filenames

Post by Raindrops »

Typically, research papers tend to have a very long verbose title, which is difficult to read.

So I have developed a list of shorthand names.

Here are a few shorthand I use:
  • Constructed wetlands -> CW
  • Sewage Treatment Plant -> STP
  • Horizontal subsurface filter -> HSSF
  • Wastewater -> WW
  • groundwater -> GW
But I have to do this manually for every file I download.
This is tedious.

Can Everything automate this conversion?

I should be able to define a "longhand -> shorthand" look-up table, as a one-time activity.

After that, I should be able to use a batch process command to find all longhand terms in the filenames, and replace them with their corresponding shorthand versions.
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Feature request: Batch process to replace predefined strings with other strings in filenames

Post by void »

How to replace parts of search string automatically before launching the search?

A Synonyms list is on my TODO list.

Thank you for the suggestion.
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Feature request: Batch process to replace predefined strings with other strings in filenames

Post by Raindrops »

oops- I mean renaming of the files in batch-processing, not using the shorthands while searching.

This request is the inverse of that other thread.
Here, I want to rename the downloaded files using my shorthand definitions.

Since I keep downloading new files, all such files need to be renamed using the same set of shorthands.
That's why I need a batch-processing command.
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Feature request: Batch process to replace predefined strings with other strings in filenames

Post by void »

One word at a time:
  • Search for one of the words to replace, for example:
    Constructed wetlands
  • Select the files you wish to batch process.
  • Press Shift + F2.
  • This will show the Advanced Rename.
  • Check Regular Expressions.
  • Change the Old format to: \bConstructed wetlands\b
  • Change the New format to: CW
  • Double check the generated new filenames.
  • Click OK.


Multiple word replacements at the same time:
  • For for your files, for example:
    <Constructed wetlands> | <Sewage Treatment Plant> | <Horizontal subsurface filter> | <Wastewater> | <groundwater>
  • Select the files you wish to batch process.
  • Press Shift + F2.
  • This will show the Advanced Rename.
  • Uncheck Regular Expressions.
  • Change the Old format to: %1
  • Change the New format to:

    Code: Select all

    <regexreplace:<regexreplace:<regexreplace:<regexreplace:<regexreplace:%1,(?i)\bConstructed wetlands\b,CW>,(?i)\bSewage Treatment Plant\b,STP>,(?i)\bHorizontal subsurface filter\b,HSSF>,(?i)\bWastewater\b,WW>,(?i)\bgroundwater\b,GW>
    
  • Double check the generated new filenames.
  • Click OK.
Post Reply