3 ms·
Hi jwmhjwmh - thanks for posting this. I just wanted to add, for me, two important features of a utility like this are 1. to accept input from a pipe, and 2. to
by version_five 5y ago
Hi jwmhjwmh - thanks for posting this. I just wanted to add, for me, two important features of a utility like this are 1. to accept input from a pipe, and 2. to specify a delimiter. My usual use would be
data source | processing | plot
E.g. a csv, cut or awk, then either print the data or plot. The features I suggested make this workflow easier, but I don't know how common that is. I'd be interested to know how other people would use this.
- jwmhjwmh 5y agoThe script does accept input from a pipe, just as Awk does. Specifying a delimiter seems like it should be doable. To answer your question, I mainly use this for counting lines of code: cloc --by-file --csv src/ | awk -F, '/^C/{print$5,$2}' | barchart | less (The above pipeline counts the lines of C code in files in the src directory.) EDIT: Actually, the script can pretty easily support alternative delimiters. Let's say you wanted "," as a delimiter. Instead of writing: barchart data Just write: sed 's/,/ /' data | barchart (This sed invocation will only replace the first comma, so it won't mess with your labels.)