12Ghosts Inc.

12Ghosts Power Tools for Windows

Security   SysTools   Automation   Files & More
  Wash  Shredder  StartupGuard     
Tweak  Quick  NotePad       
      Sync  ShowTime  Timer       
Backup  Replace  FileDate       
SetupSFX  Silencer  RunAsStdUser  ChooseColor   

12Ghosts Replace

Search and replace in multiple files or complete folders

Tucows:, WinFiles


What does it do for me?

Search and replace text in all files of a folder, including subfolders. Automatically replace text, numbers, bytes, or any part of a file. For example, update a formatting throughout your website, change a price in many documents at once, or replace a description in all fields of a database.

If necessary, you can even replace with the contents of a separate file. The whole process can be scripted to automate replacing text.

Control each replacement in a straight-forward preview window. Commands like Replace All in This File or Skip This File will help you to quickly go through a large number of files.

Search options include case and word, as well as include and/or exclude filters. Replacing text with this tool is easy, fast and reliable.




Replace it again, Sam!

Path, search, and replace phrase of the last 20 searches are available in drop-down lists. It's easy to repeat the same replace-operation later.


Multi-line Search and Replace

Imagine you need to replace the following code snippet throughout your web site with a different script. Replacing with the contents of a file is not the problem, but searching for multiple lines is.

<script type="text/javascript">
    document.write('<img src="/cgi-bin/draw.pl?trans.gif&ref=');
    document.write('" height="1" width="1" title="" />');
// -->
<img src="../images/trans.gif" height="1" width="1" title="" />

One way to do this is to replace the end-of-lines with \:r\:n, for the same example:

<script type="text/javascript">\:r\:n<!--\:r\:n    document.write('<img src="/cgi-bin/draw.pl?trans.gif&ref=');\:r\:n    document.write(document.referrer);\:r\:n    document.write('" height="1" width="1" title="" />');\:r\:n// -->\:r\:n</script>\:r\:n<noscript>\:r\:n <img src="../images/trans.gif" height="1" width="1" title="" />\:r\:n</noscript>\:r\:n

Another idea, and much easier to set up, would be to use a wildcard asterisk (see following paragraph). You would need some unique text at the beginning and end of the search text. For the above example:

<script type="text/javascript">*</noscript>

However, that may find other occurances as well. The best way would be using a unique marker, for example:

<!-- yourMarker START new.txt -->
<!-- yourMarker END new.txt -->

which can be replaced with (see also Command Line Options below):

"...\12replace.exe" "...\YourFolder" "<!-- yourMarker START new.txt -->*<!-- yourMarker END new.txt -->" "...\new.txt" /replaceall /nosound /sub /only /contents

"yourMarker" is just some text that is not used anywhere else. Also, START and END is totally made up, you could use any text to identify the beginning and end of your multi line search text. Using the replace file name is a good way to identify and differentiate each marker. 

In the source of our help and web pages you'll find several of such markers (look for "bot12" as our marker).


Convert UNIX text to Windows text

Have you ever opened a text that was somehow scrambled and without paragraphs? You probably opened a text created on a UNIX machine where a single line feed character \:n is used instead of a carriage return and line feed \:r\:n as on Windows.

To replace carriage returns and line feeds easily, 12-Replace supports the standard \:r and \:n character combinations. For example, you can search for "\:n" (UNIX) and replace with "\:r\:n" (Windows) to convert the text from UNIX format to Windows format. Or the other way round!













12Ghosts Power Tools for Windows®

Copyright © 1993-2014 12Ghosts Inc. All rights reserved.