Sort Old Style Key Definition


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Sort Old Style Key Definition
# 1  
Old 03-21-2008
Data Sort Old Style Key Definition

Hello guys,

I am quite confused with old style key definitions.

Below is the example:

sort -o $sortfile +0.75 -0.84 $input

According to the manual, the key field should start at 75th character of the 1st(0+1) field and key's last position should be 84th character after end of "0"th field

Can anyone explain me what is the "0"th field and how actually the key is defined in the case above Smilie

Also, please tell me what happens if the key definition exceeds the range of input file ( for example if the longest line is or 40 character, and i define the key from 80-85) Smilie

Thanks in advance!!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Programming

Get struct definition

I have many headers with huge amount of structures in them, typical one looks like this: $ cat a.h struct Rec1 { int f1; int f2; }; struct Rec2 { char r1; char r2; }; struct Rec3 { int f1; float k1; float ... (6 Replies)
Discussion started by: migurus
6 Replies

2. Solaris

Solaris 8 ssh public key authentication issue - Server refused our key

Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks. ... (1 Reply)
Discussion started by: aixlover
1 Replies

3. UNIX for Dummies Questions & Answers

Definition of $-

Could someone please direct me to a link that gives the definitions for each of the letters from the results of the $- environment variable? It would be nice to know what shell options each of the letters represents, but I am specifically looking for the shell option for 'c' (lowercase c). Thank... (12 Replies)
Discussion started by: sszd
12 Replies

4. Shell Programming and Scripting

Perl function to sort a file based on key fields

Hi, I am new to PERL.I want to sort all the lines in a file based on 1,2 and 4th filelds. Can U suggest me a command/function in perl for this operation.. (5 Replies)
Discussion started by: karthikd214
5 Replies

5. Shell Programming and Scripting

daemons definition

hi there, can somebody give me a definition for daemons, or example what are they !! and what the use for? i've done some research and all what i found is /etc/... or /usr/bin/... and i haven't quietly got the concept. any ideas !! Thanks. (5 Replies)
Discussion started by: new2Linux
5 Replies

6. UNIX for Dummies Questions & Answers

Pressing backspace key simulates enter key

Hi, Whenever i press the backspace key, a new line appears, i.e. it works like a enter key. :confused: Thanks (2 Replies)
Discussion started by: vibhor_agarwali
2 Replies

7. UNIX for Dummies Questions & Answers

2nd sort key

Hi, I was trying to sort a file with one sort key in the first field and trying to sort again based on the 2nd field. After the sort command , the first sorted file will look like this: 1 apple OH 2 pear OH 3 pear IL 4 apple FL 5 pear FL 6 apple MI I'd like to have it sort on the 2nd... (1 Reply)
Discussion started by: whatisthis
1 Replies

8. Post Here to Contact Site Administrators and Moderators

New Style

Hi, I pop in here every so oftern and was suprised to see the changes in colour. I think the new style/colour is great :D (1 Reply)
Discussion started by: Ralf
1 Replies
Login or Register to Ask a Question
Sort::Key::Multi(3pm)					User Contributed Perl Documentation				     Sort::Key::Multi(3pm)

NAME
Sort::Key::Multi - simple multikey sorts SYNOPSIS
use Sort::Key::Multi qw(sikeysort); my @data = qw(foo0 foo1 bar34 bar0 bar34 bar33 doz4) my @sisorted = sikeysort { /(w+)(d+)/} @data; DESCRIPTION
Sort::Key::Multi creates multikey sorting subroutines and exports them to the caller package. The names of the sorters are of the form "xxxkeysort" or "xxxkeysort_inplace", where "xxx" determines the number and types of the keys as follows: + "i" indicates an integer key, "u" indicates an unsigned integer key, "n" indicates a numeric key, "s" indicates a string key and "l" indicates a string key that obeys locale order configuration. + Type characters can be prefixed by "r" to indicate reverse order. + A number following a type character indicates that the key type has to be repeated as many times (for instance "i3" is equivalent to "iii" and "rs2" is equivalent to "rsrs"). + Underscores ("_") can be freely used between type indicators. For instace: use Key::Sort::Multi qw(iirskeysort i2rskeysort i_i_rs__keysort i2rs_keysort); exports to the caller package fourth identical sorting functions that take two integer keys that are sorted in ascending order and one string key that is sorted in descending order. The generated sorters take as first argument a subroutine that is used to extract the keys from the values which are passed inside $_, for example: my @data = qw(1.3.foo 1.3.bar 2.3.bar 1.4.bar 1.7.foo); my @s = i2rs_keysort { split /./, $_ } @data; SEE ALSO
For a more general multikey sorter generator see Sort::Key::Maker. COPYRIGHT AND LICENSE
Copyright (C) 2006 by Salvador Fandin~o <sfandino@yahoo.com> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available. perl v5.14.2 2010-04-16 Sort::Key::Multi(3pm)