![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to serach for Values grater tan 4 digits in a file using Awk Command | samura | Shell Programming and Scripting | 1 | 09-15-2009 09:15 AM |
| How to sort a field in a file having date values | risshanth | Shell Programming and Scripting | 4 | 06-04-2008 05:03 AM |
| Converting Binary decimal coded values to Ascii Values | gaur.deepti | UNIX for Advanced & Expert Users | 3 | 04-02-2008 12:33 PM |
| How to sort decimal values in bash | ahjiefreak | Shell Programming and Scripting | 1 | 01-21-2008 09:25 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
how to sort date in decimal values uptp two digits
Hi all,
there is a data in a file wich loks likes Code:
00:00:49|24.48| 00:01:49|22.83| 00:02:49|22.07| 00:03:49|20.72| 00:04:49|21.28| 00:05:49|21.22| 00:06:49|21.38| 00:07:49|20.93| 00:08:49|21.27| 00:09:49|20.65| 00:10:49|19.42| 00:11:49|21.93| 00:12:49|20.62| 00:13:49|20.23| 00:14:49|20.23| 00:15:49|20.48| 00:16:49|21.50| 00:17:49|19.95| 00:18:49|20.47| 00:19:49|19.40| 00:20:49|17.23| 00:21:49|19.47| 00:22:49|19.27| 00:23:49|18.02| 00:24:49|18.78| 00:25:49|17.53| 00:26:49|18.40| 00:27:49|17.48| 00:28:49|17.32| 00:29:49|16.62| HTML Code:
I tried several command but i am not getting my desired output, Can anyone hep me out. Code:
cat file.wri | sort -n -k 2.1 -k 2.2 -k 2 | more cat file.wri | sort -n -k 4.1 -k 4.2 -k 4 | more cat file.wri | sort -n -k 10.1 -k 10.2 -k 10 | more cat file.wri | sort -n -k 10 -k 11 | more cat file.wri | sort -n -k 9 -k 10 | more |
|
||||
|
hmm thankz panyam for the reply, but i m afraid this dont work as the output did sort but accroding to first digit. here's what the output
Code:
03:22:49|3.90| 03:25:49|3.90| 03:44:49|3.97| 05:09:49|3.98| 10:42:49|30.02| 10:39:49|30.07| 14:21:49|30.07| 16:45:49|39.97| 17:20:49|39.98| 22:11:49|39.98| 03:20:49|4.00| 03:30:49|4.03| 05:08:49|4.07| 03:33:49|4.08| i.e if valule is 39.98 its sorting data according to 3 and and then later 4.00 i want it should be sorted by taking into account the digits before point(.) i.e. larger value at the end. Hope its clear now |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|