Presort Data Files
Posted: Thu Apr 25, 2013 1:40 pm
Hi,
I think it may be faster to load data files if I presort them. I'm having trouble getting the sort command to work. Specifically when trying to use a pipe field delimiter...
For example, I want to sort the data file test.txt by the second column:
How do I tell the sort command I am using the pipe delimiter?
I think it may be faster to load data files if I presort them. I'm having trouble getting the sort command to work. Specifically when trying to use a pipe field delimiter...
For example, I want to sort the data file test.txt by the second column:
Code: Select all
bash-3.2$ cat test.txt
G|1
H|50
K|22
I|2
B|300
Z|4
P|200
bash-3.2$ sort -t| +1 -1 test.txt > test1.txt
bash: +1: command not found
sort: option requires an argument -- t
Try `sort --help' for more information.
bash-3.2$