Tools‎ > ‎Ubuntu/Linux server‎ > ‎

Extract columns from file


print column 2 of file 'table.txt'
cut -f 2 table.txt
print output to new file
cut -f 2 table.txt > column2.txt

print column 3 and 4 of file 'table.txt'
cut -f 3,4 table.txt

switch column 3 and 4
paste <(cut -f4 table.txt) <(cut -f3 table.txt)


See also: awk