I tried searching for this everywhere but couldn't find any solution. I have 100 html pages with various text to translate. I have also the translated text ready on a word document. So what I have to do is find multiple blocks of different text and replace them with multiple blocks of the translated text. I use normally dreamweaver which has a good find/replace function but it can only replace 1 block of text at a time. More specifically as an example, say i have 3 sentences (I personally have far more, something like 1000 different sentences to be replaced):


and want to replace all 3 of them respectively at once with:


I need to find the "english blocks of text" wherever they may be in the html documents and replace them with the "spanish blocks of text" all at once without having to repeat the find/replace process thousands of times.

I am sure this is possible. I need a free utility for MAC or either someone to explain me exactly how i can achieve this in dreamweaver or elsewhere using Regular Expressions (which unfortunately I don't know anything about).

Thanks a lot in Advance.


Few options here:

  1. OP's mention of DreamWeaver strikes me as being a tool-oriented user so check out a free text editor like Notepad++. It has has a "replace text in files" function which will do what you're looking for with multiple search-and-replace.
    • copy all files into a single root folder (it's OK to have files in subfolders, they should just all be under one root folder like /docs - /docs/folder1, /docs/folder2 is oK. You can have them in different places too, it will just require you to do this for each folder.
    • Install Notepad++, by searching from google or install from PortableApps (at portableapps.org)
    • under search, choose Find In Files and specify find/replace block.
  2. On Unix, use a tool like find piped to sed. If that's gibberish to you, consult with Dr. Google.
  3. Write a program. This is the long way 'round unless you're already comfortable with a language.
  4. Use something like google translate, again might be the long way 'round if you're not already a maven.

Based on what you said, I'd start with #1 and then go to #2 if that doesn't work out.

  • Sed is great, but you don't have to use a pipe with it. It can edit files in-place as easily. – Zoredache Jul 6 '12 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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