1

Possible Duplicate:
How can I mass rename files from the command line or using a 3rd party tool?

I have many PDFs of EBooks but some of them have underscores in their filenames so it becomes difficult to search the file by some words. Is there any program/script/software which replace all underscores with blank space in windows 7

Mirage
  • 2,903

2 Answers2

1

It is really old software, but I use Lupas Rename 2000 to rename files in bulk. One of the rules you can use is "Replace text (_) with new text ( )".

It was last updated in 2005, but it is light, fast, and still works in Windows 7.

1

From the command line:

dir *.pdf /b | mawk "/ / { q=sprintf('%c',34); new=$0; gsub(/ /, '_', new ); print     'ren 'q$0q' 'new }"

This command will not do anything, but output the command about to be executed. To execute it, you just add cmd at the end:

dir *.pdf  /b  |  mawk  "/ / { q=sprintf('%c',34); new=$0; gsub(/ /, '_', new ); print 'ren 'q$0q' 'new }" | cmd

You can download mawk.exe from http://www.klabaster.com/freeware.htm#mawk

jftuga
  • 3,237