Skip to content

ramdeoshubham/xpr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

✨ XPR - Command-Line String Manipulation Utility

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! 😎

Installation

Compile the program using GCC:

gcc -o xpr xpr.c

Run it directly:

./xpr [file] [option] [arguments...]

Options & Examples

  • 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 (-h or --help)

    ./xpr -h
    ./xpr --help
  • Version (-v or --version)

    ./xpr -v
    ./xpr --version

License

This project is licensed under the MIT License.

About

C command line utility for text and string manipulation

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages