Last active
December 1, 2020 01:37
-
-
Save novemberkilo/f58da37c276e023ef9c25feb601bbc64 to your computer and use it in GitHub Desktop.
cli hints and tricks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Sum the numbers in a column with header 'value' | |
cat data.csv | xsv select value | tail -n+2 | awk '{ SUM += $1} END { print SUM }' | |
## xargs with multiple ops -- here drop a column from all csv in this dir and store results | |
## in another directory | |
ls | xargs -L 1 -I 'file' sh -c "xsv select '\!original_area_code' 'file' > no_original_area_code/'file'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment