XPR is a lightweight C program designed to work with text files.
It allows you to search, replace, append, and display file contents with line numbers.
Created primarily as a learning and demonstration project to explore command-line utilities and string handling in C.
Experiment, learn and extend it! 😎
Compile the program using GCC:
gcc -o xpr xpr.cRun it directly:
./xpr [file] [option] [arguments...]-
Display file contents with line numbers (
-o)./xpr sample.txt -o
-
Append a string to the file (
-a)./xpr sample.txt -a "This is a new line" -
Search for a string in the file (
-s)./xpr sample.txt -s "apple" -
Replace a string and save to a new file (
-r)./xpr sample.txt -r "old" "new" output.txt
-
Help (
-hor--help)./xpr -h ./xpr --help
-
Version (
-vor--version)./xpr -v ./xpr --version
This project is licensed under the MIT License.