cut - I use this program quite often to select columns from a grid.
paste - join two files line by line with corresponding lines separated with a tab.
file=2007-01-23-1520 out=index.txt paste <(cut -d $'\t' -f 3 $file) <(cut -d $'\t' -f 1,2,4,5,6 $file) | sort > $out
Basically the two cuts run in parallel, and are piped into paste which reads each a line at a time and outputs the pasted lines, the rest of the command line just sorts the result and saves it to a file.
I am doing this to try and do a binary search on the text file.
No comments:
Post a Comment