I have very large data which I want to sort on
- column 1: numerically and then alphanumerically
- then on column 2: numerically.
So, my final output would be something like this:
1 11
1 13
1 15
2 3
2 5
chr2 6
chr2 15
chr15 3
chr15 9
I am using sort
on unix. But, I either keep getting chr2 on the top or on the bottom with any sort I try. Here are some of the sort I tried: which fail to give me the desired output:
sort -V -k1,1n -k2n final_merged.txt > merged-sort.txt
sort -k1,1n -k2n final_merged.txt > merged-sort.txt
sort -k1,1h -k2n final_merged.txt > merged-sort.txt
sort -k1,1 -k2n final_merged.txt > merged-sort.txt
Post edit: Any way to fix this issue without overloading the memory while using
- sort or other unix utilities
- python
Thanks,