Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a free program that can scan all .xml files in a directory and replace a certain string occurrence.

share|improve this question
up vote 5 down vote accepted

Assuming you use Windows, Windows Grep can do this! It's free.

Replacing as well as searching: Once you have performed a search you can change the matches found to another string in all files or a single file, quickly, easily and safely. In beginner mode, the Replace Assistant gently guides you through the process.

share|improve this answer
Indeed. As any other find & replace software. I'd like to call the attention also to TextCrawler ( which includes a very(!) useful Regular Expressions Test Tool and a library of commonly used regular expressions. – A Dwarf Sep 30 '09 at 9:51
the "windows grep" free version is supposed to be used for eval purpose. They encourage you to register! – anjanbacchu Jul 22 '11 at 14:21
Does not work for binary files. Sometimes files automatically written out as .csv are treated as binary files in Windows Grep and it fails miserably when trying to replace text in them – user48930 Jan 29 '13 at 6:35

Use sed:

find /dir -type f -exec sed -i 's/old/NEW/g' {} \;

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .