Sponsored Content
Top Forums Shell Programming and Scripting how to sort date in decimal values uptp two digits Post 302368048 by jojo123 on Wednesday 4th of November 2009 04:28:42 AM
Old 11-04-2009
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|

I need to sort second feild in ascending order..

HTML Code:
I tried several command but i am not getting my desired output, Can anyone hep me out.
here's what i tried

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

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to sort decimal values in bash

Hi, I have a list of values from associative array from 0,..till 1.0000. I tried various sort options; sort -g, sort -nr but it still couldnt work. In other words, the numbers are not sorted accordingly. Please help. Thanks. (1 Reply)
Discussion started by: ahjiefreak
1 Replies

2. UNIX for Advanced & Expert Users

Converting Binary decimal coded values to Ascii Values

Hi All, Is there any command which can convert binary decimal coded values to ascii values... i have bcd values like below оооооооооооо0о-- -v - Pls suggest a way to convert this. Thanks, Deepti.Gaur (3 Replies)
Discussion started by: gaur.deepti
3 Replies

3. Shell Programming and Scripting

How to sort a field in a file having date values

Hi All, I am having a pipe delimited file .In this file the 3rd column is having date values.I need to get the min date and max date from that file. I have used cut -d '|' test.dat -f 3|sort -u But it is not sorting the date .How to sort the date column using unix commands Thanks ... (4 Replies)
Discussion started by: risshanth
4 Replies

4. Shell Programming and Scripting

How to get decimal values ?

Hi All, In my script I've written like this- c=$( expr 100 / 3);echo $c The output coming is 33. but I want to see 33.33, decimal values too. How to get that? Thanks, Naresh (3 Replies)
Discussion started by: NARESH1302
3 Replies

5. Shell Programming and Scripting

number of digits after decimal

Hi All, I have a file of decimal numbers, cat file1.txt 1.1382666907 1.2603107334 1.6118799297 24.4995857056 494.7632588468 560.7633734425 ..... I want to see the output as only 7 digits after decimal (5 Replies)
Discussion started by: senayasma
5 Replies

6. Shell Programming and Scripting

remove directories with two digits after decimal point

Hi everyone, I am new here and generally not experienced with linux. My question must be easy, but as for now I have no idea how to do it. I have lots of directories with numerical names, e.g. 50 50.1 50.12 etc. What I want is to leave directories with no or single digit after the decimal... (2 Replies)
Discussion started by: cabaciucia
2 Replies

7. Shell Programming and Scripting

Sort Decimal number in UNIX

Hello Everyone, In one of my script, I would like to sort the decimal numbers. For e.g. If I have numbers like 1.0 1.1 1.2 2.0 2.1 3.0 4.0 5.0 6.0 7.0 7.1 7.10 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 I would like to sort them 1.0 1.1 1.2 2.0 2.1 3.0 4.0 5.0 6.0 7.0 7.1 7.2 7.3 7.4... (3 Replies)
Discussion started by: sachinrastogi
3 Replies

8. Shell Programming and Scripting

How to sort when there is variable length decimal points.?

Hi Experts, Quick quesion: I want to sort this in the file , but not working, when using # sort file name 305.932 456.470 456.469 456.468 456.467 172.089 456.467 456.466 456.465 111.573 111.578 111.572 111.572 87.175 87.174 75.898 (4 Replies)
Discussion started by: rveri
4 Replies

9. Shell Programming and Scripting

Printing with decimal places from last 4 digits

I have input file like below, 201424|9999|OSS|622010|RGT|00378228764 201424|8888|OM|587079|RGT|00284329675 201424|7777|OM|587076|RGT|00128671024 201424|6666|OM|581528|RGT|00113552084 Output should be like below, should add decimal (.) from last 4 digits. ... (2 Replies)
Discussion started by: vinothsekark
2 Replies
FC-MATCH(1)															       FC-MATCH(1)

NAME
fc-match - match available fonts SYNOPSIS
fc-match [ -asvVh ] [ --all ] [ --sort ] [ --verbose ] [ -f format | --format format ] [ --version ] [ --help ] [ pattern [ element ... ] ] DESCRIPTION
fc-match matches pattern (empty pattern by default) using the normal fontconfig matching rules to find the best font available. If --sort is given, the sorted list of best matching fonts is displayed. The --all option works like --sort except that no pruning is done on the list of fonts. If any elements are specified, only those are printed. Otherwise short file name, family, and style are printed, unless verbose output is requested. OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. -a --all Displays sorted list of best matching fonts, but do not do any pruning on the list. -s --sort Displays sorted list of best matching fonts. -v --verbose Print verbose output of the whole font pattern for each match, or elements if any is provided. -f --format format Format output according to the format specifier format. -V --version Show version of the program and exit. -h --help Show summary of options. pattern Displays fonts matching pattern (uses empty pattern by default). element If set, the element property is displayed for matching fonts. SEE ALSO
fc-list(1) FcFontMatch(3) FcFontSort(3) FcPatternFormat(3) fc-cat(1) fc-cache(1) fc-pattern(1) fc-query(1) fc-scan(1) The fontconfig user's guide, in HTML format: /usr/share/doc/fontconfig/fontconfig-user.html. AUTHOR
This manual page was updated by Patrick Lam <plam@csail.mit.edu>. 16 April 2012 FC-MATCH(1)
All times are GMT -4. The time now is 05:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy