Bash - cut
Cut the columns/fields 1-3, 5, 7
cut -f1-3,5,7 input.txt > ouput.txt
Cut using the comma delimiter column/field 3 from input.txt redirected to output.txt
cut -d"," -f 3 input.txt > output.txt
- Print selected parts of lines from each FILE to standard output.
-c, --characters=LIST
select only these characters
-d, --delimiter=DELIM
use DELIM instead of TAB for field delimiter
-f, --fields=LIST
select only these fields;
also print any line that contains no delimiter character, unless the -s option is specified
-s, --only-delimited
do not print lines not containing delimiters
--output-delimiter=STRING
use STRING as the output delimiter the default is to use the input delimiter
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.