Mostly Linux & Python syntax notes and hyperlinks.

Wednesday, August 19, 2009

My Linux/Unix bookmarks: cut, join, sort

cut assumes tab delimiters. To cut using space as a delimiter, use -d' '
$ cat > foo
a b c d
e f g h
h i j k
a b c d
$ cut -d' ' -f 1,3 foo
a c
e g
h j
a c
join join two files by a common field. (after you sort.)
join [options] file1 file2

sort

No comments:

Post a Comment