I have written some bash shell scripts, using grep and sed. Are there any functions in C that do something similar to grep and mainly sed? I need to be able to edit and delete individual lines of text in an external txt file, based on user input.

You don't need either of those two programs. To edit a text file just completely rewrite it. Open the original for reading, open a new file for writing, in a loop read a line from the original file, edit it as necessary, then rewrite it to the output file (or just ignore it if you want to delete it). When done, close both files, delete the original file, then finally rename the new file with the same name as the original file.

There are no standard C functions that perform regular expressions. If you were using c++ then you could get such a library from boost

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.