How to scrub a document of all text between brackets with find and replace

1

I have a log file and I need to find all instances of <password> hash here </password> and remove the hash and replace it with some dummy text like aaa-aaa-aaa-aaaa.

The recurring search argument is anything that matches a bracket that starts with <password> and ends with </password>. All the hashes being replaced will be different.

What's the easiest way to go a bout this? The log is on a windows machine. Probably easiest would be to use MS word for me, unless it's achievable with wordpad, notepad, or some other light weight editor like textpad.

thanks

user37200

Posted 2010-05-14T18:28:26.743

Reputation:

Answers

2

You can do it with SciTE (very lightweight), but any editor that supports regular expressions should be fine.

Use the replace feature ->

 Find what - <password>.*</password>
 Replace with - <password>helloWorld</password>

Regular expression - yes

bryan

Posted 2010-05-14T18:28:26.743

Reputation: 7 848

textpad can also do this. – Daisetsu – 2010-05-14T20:39:40.517

0

FARt.exe

 http://fart-it.sourceforge.net/

Command line for you

 fart "filepath"  "<password> hash here </password>" "<password>sdasdadaasd</password>" 

ggonsalv

Posted 2010-05-14T18:28:26.743

Reputation: 343