File Name: ROTFL - Replacement Of Text Files
File Submitter: Nuno Brito
File Submitted: 22 Dec 2011
File Updated: 22 Dec 2011
File Category: Tools
This command line tool replaces a given text sequence with another.
Why this tool?
After this forum was upgraded, a lot of the forum posts were not displayed correctly as before. Therefore it was needed to change the SQL file to bring back the original characters. Many people posted solutions to this matter, however our database is large and it was necessary a tool that could do these replacements with a low memory foot print.
It was possible to use SED under Linux but the result was not comfortable and still a lot of manual labor was involved. So, it was an interesting exercise to code a tool for this task.
What distinguishes this tool from others?
- Based on Java, works on Windows, OSX and Linux when Java is installed
- Accepts a list of words to replace (edit settings.txt)
- Is prepared to handle big text files (tested on file of 600Mb in about 30 seconds as seen on screenshot)
To run from Windows
rotfl param1 param2
To run from Linux or OSX
java -jar rotfl.exe param1 param2
param1 is the source file
param2 is the output file
Customizing the settings
To change the list of replaced characters, just edit settings.txt to match your preference.
Click here to download this file