Some Linux Text Processing Notes Mar 2, 2019 cut Edit single column of csv file # the following takes the first two columns of a CSV file (FILE), and performs a sed cleaning on the second paste -d"," <( cut -d"," -f1 FILE ) <( cut -d"," -f2 FILE | sed -e 's/from/to/g' ) >OUTPUT Edit column of single file, skipping header paste -d"," <( cut -d"," -f1,2 $INFILE ) \ <( \ cat <( head -1 $INFILE | cut -d"," -f3- ) \ <(tail +2 $INFILE | cut -d"," -f3- | ./replace-bytes.sh $NUM_BYTES) \ ) \ >$OUTFILE sed Lowercase sed -e 's/\(.*\)/\L\1/g' Remove punctuation sed -e 's/[[:punct:]]\+//g' grep Get unique characters in file grep -o "." FILE | sort | uniq awk Sort lines in file by length in characters cat FILE | awk '{ print length, $0 }' | sort -n -s | cut -d" " -f2-