I have a file with multiple instances of Text_1
and Text1
and I need to replace both those strings with Text_A
and TextB
respectively.
Currently I'm doing two Find and Replace functions on each file one that finds Text_1
and replaces it with Text_A
and the other that finds Text1
and replaces it with TextB
.
Is there any way to do this all at once instead of having to run "Find and Replace" twice?
I am using Dreamweaver CS3, but I also have Notepad++, regular Notepad, OO Writer, MS Word if those will be easier. Ideally I could do this in Dreamweaver or Notepad++ but I'm open to downloading something else to get the job done. I'd prefer not to have to do any command line stuff or create a batch file (while I'm aware of it, I don't understand it really).
In case the above description isn't clear, let me explain it this way...
I want to run Find & Replace 1 time in 1 document and I want it to do ALL of the following during that one Find & Replace instance:
- Find
Text_1
and Replace withText_A
- Find
Text1
and Replace withTextB
I am not trying to do a Find and Replace across several documents.
Answer
Take a look at Sed. You can easily achieve your goal by only one command line
sed -e "s/Text_1/TextA/" -e "s/Text1/TextB/"
No comments:
Post a Comment