Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers

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 (digitalvolcano.co.uk/content/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
add comment

Use sed:

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.