bash - Linux reverse sorting giving wrong results -
i have data of following format:
diplomat 9.35003521034e-07 golden 0.0 projection 5.75975635192e-06 harvey 9.25224016662e-08 omelianchuk 8.77038876791e-08 stern 6.23335680688e-08 insecurity 0.0 century 0.000814828405418 karadzic 0.0 vernon 5.56509185654e-08 music 0.0 therefore 0.000486949687357 diabetes 0.0 yahoo 0.0 meteorologist 6.80717342684e-08 aynsley-green 0.0 intake 0.0 morally 0.0 locker 0.0 colombia 0.0 mahela 1.08371146396e-07
i want sort data according values in second column. used linux command
sort -r -g -t $'\t' -k2,2
i used -g generic sorting. still not giving me correct output. getting result out of order.
the output got was:
yahoo 0.0 vernon 5.56509185654e-08 therefore 0.000486949687357 stern 6.23335680688e-08 projection 5.75975635192e-06 omelianchuk 8.77038876791e-08 music 0.0 morally 0.0 meteorologist 6.80717342684e-08 mahela 1.08371146396e-07 locker 0.0 karadzic 0.0 intake 0.0 insecurity 0.0 harvey 9.25224016662e-08 golden 0.0 diplomat 9.35003521034e-07 diabetes 0.0 colombia 0.0 century 0.000814828405418 aynsley-green 0.0
i tried multiplying values 10 following 7 zeros , sorting, still didn't work.
awk '{print $2*100000000}' infile
how can fix this? please help!
tried sort data with
sort -r -g -t' ' -k3,3
and output looks fine me. separator space. , there space @ beginning of each line, number third column.
i got output
century 0.000814828405418 therefore 0.000486949687357 projection 5.75975635192e-06 diplomat 9.35003521034e-07 mahela 1.08371146396e-07 harvey 9.25224016662e-08 omelianchuk 8.77038876791e-08 meteorologist 6.80717342684e-08 stern 6.23335680688e-08 vernon 5.56509185654e-08 yahoo 0.0 music 0.0 morally 0.0 locker 0.0 karadzic 0.0 intake 0.0 insecurity 0.0 golden 0.0 diabetes 0.0 colombia 0.0 aynsley-green 0.0
Comments
Post a Comment