Replaces duplicates in common text for better readability.
- Text: lazy fox jumps over jumps over the brown dog
- is replaced with: lazy fox jumps over the brown dog
- Linux, Mac OS X or cygwin
- Installed g++, make, automake, autoconf and boost
- Example of necessary packages for Ubuntu/Debian:
apt-get install build-essential g++ autoconf automake \
pkg-config libtool libboost-dev autoconf-archive \
libboost-program-options-dev libboost-system-dev \
libboost-filesystem-dev
- Installed g++, cmake and boost
- Example of necessary packages for Ubuntu/Debian:
apt-get install build-essential g++ cmake libboost-dev \
autoconf-archive libboost-program-options-dev \
libboost-system-dev libboost-filesystem-dev
./autogen
make
cmake .
make
./test.sh
./replace --help
Search in the text file for all word or sentence
duplicates, removes them and saves the text to
output file
Usage: replace [options] <input file> <output file>
Allowed options:
--help Print usage
-p [ --print-duplicates ] Enables print of duplicates to stdout
-s [ --separators ] arg Set separators. Default value is $' \n'
--input-file arg Path to input file - mandatory argument
--output-file arg Path to output file - mandatory argument
The text file is loaded into memory so trying to process files bigger then is amount of your workstation memory can cause program failure or significant slow down of your OS.
The text file must have Linux new line format (for Windows "\r\n" it probably won't work). To convert to Linux format you can use utility dos2unix.