Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1280.Batch file rename -- How to batch rename files to the specified pattern found in file content?

User: Bob Foster -- 2015-02-16          << 1279  1281 >>
Hits: 1345
Type: Batch file rename   
Search all Batch file rename examples
During batch rename I would like to find a fixed length variable in the text file and use a portion of it as the file name. In source P301090 is logged and different for each file and now I would like to rename the file that number excluding the P . There are several files and they all have this string but not on the same line in each file.
Thank You.
Input Sample:
File name 145X5310-2_015b.txt
(145X5310-2  OP.015B)
Output Sample:
New file name 301090.txt
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Following steps is to find first (X******) in each file, and rename the file with ******

1. open "Tools->Batch Runner" menu
2. drag multiple files from windows file browser to "Batch Runner" window
3. check option of "set output filename", set the following entry to:

4. make sure the file name preview in "output file" column is correct.
5. click "File Rename", done.

Screenshot 1:  Batch_Runner_Window

Similar Examples:
How to batch rename files with the first word of file contents? (78%)
How to batch rename files to the first date found in the files? (77%)
How to batch rename files to the first 8 characters of the second line of file content? (75%)
How to batch rename file extension to the letter 8-10 of 2nd line of file content? (71%)
How to batch rename html files with specified text from html title tags? (70%)
How to batch rename html files to specified text from html title tags? (70%)
How to batch rename text files with random line from file contents? (70%)
How to batch rename PDF files with the date inside the file? (68%)

Check Demo of Batch file rename
fixed length  variable  several  fixed len  length  found  fixed  var  fix  correct  batch file use filename as a variable  filename variable  rename file first line windows  batch rename files text with first line string  rename text file from first line  filename length  rename text file with first line  batch rename text files with first line