Hello,
Say I have a file with plain text as shown below. Some columns may have multiple words (like "DESC 1", "DESC 1 2", "DESC 1 2 3"). Let's say the file below has 4 columns: 1st(AA), 2nd(BB), 3rd(DESC 1, ...), 4th(CC 1, ...).
I'd like to use the UNIX sort utility to sort based on these orders: 4th, 3rd, 2nd, then 1st.
How would I construct the key parameters (-k) to the sort utility?
Thank you.
Say I have a file with plain text as shown below. Some columns may have multiple words (like "DESC 1", "DESC 1 2", "DESC 1 2 3"). Let's say the file below has 4 columns: 1st(AA), 2nd(BB), 3rd(DESC 1, ...), 4th(CC 1, ...).
Code:
1234567890123456789012345678901234567890
AA BB DESC 1 2 3 CC 1 2 3
AA BB DESC 1 2 CC 1 2
AA BB DESC 1 CC 1
I'd like to use the UNIX sort utility to sort based on these orders: 4th, 3rd, 2nd, then 1st.
How would I construct the key parameters (-k) to the sort utility?
Thank you.