I'm making a university project which is supposed to read a table from stdin, apply some changes to it and print to stdout. Here's how the program should be run:
./main [delimiter] [function] <file1.txt >file2.txt
[delimiter]
is the character that will divide the cells in the resulting table, defined in the body;
[function]
is the function that will be performed to modify rows or columns, defined in the body.
So my question is, how can I read the [delimiter]
and [function]
from the terminal so that I can use them accordingly in the body of the program?