Introduction to Your Best Friend to Find and Replace Text Strings in Multiple Files, with or without Regex

What is Find & Replace It! ?

Summary

findreplaceit_icon_128.pngFind & Replace It! is a high-end solution to find files and execute search and replace operations across multiple text files. It allows performing very complex batch replacements inside text files of any size. It supports regular expression syntax and dozens of encodings charsets. It has scripting capabilities which allow transforming on the fly the replacement text for every found string. It even handles batch processing of the encoding of files, as well as of types of end-of-lines.

If you regularly work with text files, if you make websites, or develop software, Find & Replace It! allows you to maintain and transform the contents of your files in a few clicks. Do you have to rename a page in a website and thus need to edit URLs in hundreds of files? Simply select the root directory of your website and indicate the string to replace. Then, the replacement can be made across your entire website in just one click. Do you need to modify files headers in some parts of the source code of your application? Find & Replace It! allows to finely filter the files to be processed or not. It also provides tools to introduce contextual information into your replacement string, for instance: the current date, the name of the file where the replacement is in progress, etc. For each batch-replacement, it provides statistics about the number of replacements within every modified file, and counts the number of processed files. Of course, all classical features of such a tool, like the possibility to save your job, backup modified files, export the replacement report, and much more are available.

Find & Replace It! is GUI tool that handles text-based pattern matching. Its way of operating is inspired by AWK and XSLT. It allows to apply nearly any kind of transformation to any text pattern that could be described by a regular expression. Find & Replace It! enables you to:

  1. search for text patterns with regular expressions
  2. capture some sub expressions with the regex (optional)
  3. apply some text transformations to the captured expressions  (optional)
  4. inject either the raw captured text, or the transformed text into the replacement text (optional)

Briefly, here are five key points that distinguish Find & Replace It! from its competitors:

  • Handles more than 50 different kinds of text encodings. If you have troubles with any kind of Unicode data like UTF-8 encoded files, any Chinese content, or any other non ASCII contents, Find & Replace It! is the solution for you. It also handles the different kinds of end-of-line.
  • Handles huge files. If you want to process any kind of files containing tons of text, like a log of 10 GB, Find & Replace It! will do it for you.
  • Provides a regular expression editor. This editor offers tools to easily build advanced regular expressions even if you are a newbie.
  • Provides a preview for found and replaced text. The preview window gives you an immediate feed-back that makes easy to check the impact of your replacement within any file without modifying its content. This is especially useful whenever you are searching for a complex expression and you don't want to replace it blindly in many files. This is of course an excellent regex tool, that let's you easily test your regular expressions.
  • Makes it possible to dynamically adjust the replacement text. It provides many ways of dynamically adjusting the replacement text according to the context. For instance, it is possible to reuse a fragment of the found expression into the replacement text, do arithmetic operations on found text, insert the path or the name of the processed file, apply conditional operations on the replacement string (JavaScript interface), manipulate dates, etc.

These key features associated to many others makes it one of the most feature rich tool to find and replace with regular expressions across multiple files. It's also a powerful tool for converting the text encodings (charsets conversion, including the Byte Order Marks), or the end-of-line delimiters, across multiple files. In addition, it's probably the only software in this category that is cross-platform!

The software is distributed in three versions:

  • Find & Replace It! for Mac (Find and Replace It for Mac)
  • Find & Replace It! for Windows (Find and Replace It for Windows)
  • Find & Replace It! for Linux (Find and Replace It for Linux)

The GUI of Find & Replace It! consists of several panes that you can arrange in any way you want. You can dock panes side by side, arrange them in tabs, or make them float. Adjust the windows layout to the way you like to work. Find & Replace It! comes with four pre-arrange layouts that can be customized the way you want depending on the size of your screen. You can switch from one layout to another in a simple click.

Read on to discover the main features of Find & Replace It! Alternatively, you can dive into the screenshot gallery for a quick preview of its capabilities. If you want to go deeper and learn more about Find & Replace It!  we suggest that you have a look on the Demos & Tutorials and/or the User Manual (PDF).

Main Features

The list below describes some of the key features of Find & Replace It!:

  • Find and replace text in multiple files at once
  • Execute multiple different replacement operations (i.e. ability to run a sequence of several distinct replacements in one shot)
  • Supports regular expression syntax
  • Allows multi-line searching
  • Supports many text encodings, including Unicode (e.g. UTF-8)
  • Preserves line endings while processing files
  • Preserves BOM while processing Unicode files
  • Allows to perform dynamic text replacements based on found expression captures
  • Provides built-in processing function for dynamic replacements (e.g. convert captured expressions to lower case, Base64 encoding, Hex encoding, UTF-8 encoding, etc.)
  • Provides a JavaScript like interface to customize replacements on the fly by script processing
  • Displays matched expressions reports for file search/replace operations
  • Full featured dynamic preview of matched expressions and replacements
  • Provides tools for converting text encoding
  • Provides tools for converting line endings (Windows, Unix, Macintosh, Unicode)
  • Detects text encoding and line endings of files
  • Provides advanced filtering options for selecting files that need to be processed, including file name filters and file path exclusion filters
  • Allows to load and save expressions to find, replacement definitions and file filters
  • Handles huge files (> 10 GB)
  • Regular expression editor / tester
  • Fully multi-threaded for maximum performance, and great responsiveness
  • Allows to cancel long operations
  • GUI is totally modular
  • Creates backup of changed files if required
  • Exports the search and replace reports
  • Cross-platform: Windows, Mac OS X and Linux

Main Advantages over Competitors

There is a lot of "search and replace" tools on the web, but not that much who care about text encoding and end-of-lines like Find & Replace It! does. This feature enables you to effectively maintain websites, whatever the language. The same apply to us when we have to work with some source code that mixes XML configuration files, several source code files and HTML documentation. All of them use a distinct text encoding. However, whenever we have something to rename, all files need to be updated. Several competitors do not handle the encoding detection.

In the same way, most of the competitors don't like big files and might just hang if you try to handling a 2 GB file. Find & Replace It! could be the only way to do some search and replace operations inside a very large log file.

Find & Replace It! is used in some companies that work on development projects that involve dozens of thousands of file, and it works smoothly in spite of the incredibly extreme workload.

It is also the only software we've ever seen in this category, that offers a JavaScript interface to process the replacement text on the fly! You can apply some JavaScript whenever the software replaces a piece of text somewhere in a file, thus enabling any kind of contextual text transformations.

The software offers a unique preview window that enables you to open any file in order to see the matching text-patterns and the replaced content, for your active parameters of search and replace, without actually modifying the previewed file on your harddrive.

The integrated regular expression editor is one of the most sophisticated that you can find.

Finally, it is cross-platform. That is something pretty rare and very useful for developers. 

What Can you Do with the Scripting Interface?

One of the most powerful feature of Find & Replace It! is its ability to dynamically transform the texts to be replaced. This involves mixing all the classical possibilities of regular expressions with JavaScript programming. It is possible to look for very complex patterns with regular expressions. However a simple replacement by a static text is most of the time insufficient. Therefore, the scripting feature gives us all the power of JavaScript to format whatever we need and the regular expressions simply tell us where to apply the script.

The best way to really understand why this feature is so nice is probably to give some examples. Some examples are presented in a special package available for download.

Managing References to Files for a Web Site

How about automatically transform all references to file paths  into either relative or into absolute paths, according to their real location? And what would you think of inserting the size of each file somewhere in the file itself, of course with the format of your choice? Do you need to update some miscellaneous dates within some web pages by shifting them of one month? The scripting interface can bring solutions to all these kinds of problems.

Code Obfuscation

Are you looking for a way to obfuscate your source code? After a few searches on the web you should find a JavaScript  example of the AES encryption algorithm. Assuming a few tweaks, you should be able to replace all the names of your functions with their cyphered version. Then, a few minutes later you should have the script for decrypting the source code! Now you can distribute the binaries obtained from the cyphered source code, and decrypt your code for continuing the development process! Sound unfeasible? We tried it, and it worked after some adjustements for both the source code and the AES implementation.

How to Use It?

The installation instructions are available here.

Find & Replace It! is protected by a licenses system. Hence to get a license for the full version of the product you should activate your product with a serial code called Activation Key. Without the activation, the software can still be run in demo mode with some limitations. You'll find more information in the user manual.

In order to quickly get started with the main components of the GUI, here is a 2-minutes guide taken from the user manual.

All references to the online documentation and resources are listed on this documentation page.

Here is a list of supported platforms:

  • Windows:
    • Windows 2000 [not tested]
    • Windows XP [partially tested]
    • Windows Vista [not tested]
    • Windows 7 (32-bit and 64-bit)
    • Windows 8 (32-bit and 64-bit) [partially tested]
    • Windows 8.1 (32-bit and 64-bit) [partially tested]
  • Mac OS X Intel:
    • Mac OS X 10.5 "Leopard" [not tested]
    • Mac OS X 10.6 "Snow Leopard" [not tested]
    • Mac OS X 10.7 "Lion"
    • Mac OS X 10.8 "Mountain Lion"
    • Mac OS X 10.9 "Mavericks" [partially tested]
  • Linux:
    • Ubuntu 12.04 (32-bit and 64-bit)
    • Most of the recent Linux distributions (32-bit and 64-bit): Ubuntu 10.04 and up, Kubuntu 10.04 and up, Fedora 13 and up, OpenSUSE 11.2 and up, etc. [not tested]

NOTES:

  • The PowerPC architecture support has been dropped since version 1.4.0 of Find & Replace It!. You can still download version 1.3.3 (Universal Binary) on our website.
  • The support for Mac OS X 10.4 has been dropped since version 1.4.0 of Find & Replace It!. You can still download version 1.3.3 (Universal Binary) on our website.
  • The official support for Mac OS X 10.5 has been dropped since version 2.0.5 of Find & Replace It! (2012-05-14). It might contains bugs, but there will be no fix for them.
  • The platforms noted as [not tested] in the list, are platforms on which the software should work but with no warranty. All development tools used in this software are certified on these non-tested platforms but we didn't check by ourself. Most of these platforms are pretty old, that's why they are not actively supported.
  • The platforms noted as [partially tested] in the list, are platforms on which the software works but that have not been intensively tested. Therefore there might be some platform specific bugs that haven't been detected yet. Most of these platforms are pretty new, that's why they have not been actively tested so far.
  • The Linux installer requires the following commands: bzip2, lzma, xdg-mime, xdg-desktop-menu, xdg-icon-resource. If one of them is missing, the installation will stop and you might have to manually remove the installation folder.
  • Most of the modern Linux platforms should be supported. However the only tested platforms are Ubuntu 12.04 32-bit, and Ubuntu 12.04 64-bit.