The aim of project is create application, that will implement basic operations of table processors. Input for application will be text data (to stdin). Commands will be set by arguments in command line. For output use standard output (stdout).
Use makefile. That is easiest way:
make
Alternatively you can compile it on your own:
gcc -std=c99 -Wall -Wextra -Werror -pedantic -c -o sheet.o sheet.c
./sheet [-d delimiter] [table editing commands]
or:
./sheet [-d delimiter] [selection commands] [data processing commands]
Argument -d defines what characters could be interpreted as columns delimiters.
In case delimtier is not set, delimiter is space .
First delimiter from delimiters will be used as delimiter for output data.
Commands that changes table dimension.
irow R- adds new row with empty cells before rowR(R> 0)arow- adds new row with empty cells at the end of tabledrow R- deletes rowR(R> 0)icol C- adds empty column before the columnCacol- adds empty column behind last columndcol C- deletes columnCdcols N M- deletes columnsNtoM, includingMandN.
Commands that process data in table.
cset C STR- to cellCsets stringSTRtolower C- string in columnCconverts to lowercasetoupper C- string in columnCconverts to uppercaseround C- rounds number in columnCint C- removes decimal part of number in columnCcopy N M- replaces value in columnMwith value from columnNswap N M- swaps value of columnNwith value of columnM
Commands that selects range of rows to be processed.
rows N M- selects rowsNtoMincluding.- Rows from row
Nto end of table could be represented asrows N - - Last row only could be represented as
rows - -
- Rows from row
beginswith C STR- selects rows, where columnCstarts with stringSTRcontains C STR- selects rows, where columnCcontains stringSTR