avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday September 26, 2022, 10:27 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: rename opened file  (Read 2196 times)


  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,795
    • View Profile
    • Donate to Member
rename opened file
« on: March 06, 2012, 07:56 AM »

I want to rename a large amount of files based on their text content (files are have not consistent text structure)

to do so, I need to open them one by one (using a hotkey to do so) and then copy text from the file I currently view and with a hotkey to rename that file with that context (preserving file extension ofcourse)

is there a program that can help me do that?

it would be best to be able to select multiple text (not sequential) for example two words from a place in the file and then two words from another place of the file and combine these together with a space between and rename the file with that text



  • Coding Snacks Author
  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 481
  • Software Engineer
    • View Profile
    • Bitsum - Take control of your PC
    • Read more about this member.
    • Donate to Member
Re: rename opened file
« Reply #1 on: March 06, 2012, 06:54 PM »
Such things really are best scripted. Linux shell scripting, something you could use via CygWin in Windows, would be excellent for such a task. HOWEVER, you do have to have a little programmatic knowledge. Specific things like this simply require such.

I don't think you'll find any pre-written program or script to do what you want, as your needs are too unique. You might try hiring a foreign programmer at or something. But you gotta pay for their work. Fortunately, this project is simple, and their work is usually cheap.


  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,174
    • View Profile
    • Donate to Member
Re: rename opened file
« Reply #2 on: March 07, 2012, 05:19 AM »
I used to do something similar with PDFs, using one of two methods.

1) Oscar's File Renamer Free
This is an extremely unusual file renamer that makes the list of file names to be changed text-editable.  That is, it's more like using a text editor.  Changes are not committed until you press the Go button, so you can finally exit Acrobat or whatever viewer after your last file, then rename the files in one go.  It works well, but I found the interface a bit strange, and went on to a simpler means (2, below).  Oscar's is now available in original Free version, which has some problems on Vista or Win7, as noted on his Web site, plus a Pro version that fixes them and adds an improved scripting feature.  Pro is an "Unlimited Evaluation Version" with a nag screen.  $15 removes the nag.

2) Make a directory list, usually by a plugin for Total Commander, or by redirecting dir/b into a file in a DOS box.  Edit the list into a batch file, something like

ren "010339.pdf" "@@@.pdf"
ren "ningauble 072.pdf" "@@@.pdf"
ren "0946_sheelba.pdf" "@@@.pdf"

where the "@@@" are placeholders for the new names.  Alt-Tab between the viewer, accumulate the text you need, Alt-Tab back to the editor, reformat your text as necessary, and insert it into the "@@@".  When you've finished your list of files, exit your reader and run temp.bat.  Without paths, it obviously has to be in the same directory as the files to be renamed.