04-05-2006
Need Urgent help in Sorting
This is what i have in a file sortdata
IGOT C9.1.20.2DBSU10 - -
CVGRETesting C9.1.20.2DBSU11 - -
BalInqMail C9.1.20.2DBSU11 - -
SecScore C9.1.20.2DBSU8 - -
IGOT C9.1.20.2DBSU8 - -
IGOT C9.1.20.2DBSU9 - -
SecScore C9.1.20.2DBSU9 - -
When i Sort i am getting
BalInqMail C9.1.20.2DBSU11 - -
CVGRETesting C9.1.20.2DBSU11 - -
IGOT C9.1.20.2DBSU10 - -
IGOT C9.1.20.2DBSU8 - -
IGOT C9.1.20.2DBSU9 - -
SecScore C9.1.20.2DBSU8 - -
SecScore C9.1.20.2DBSU9 - -
The Order i need is DBSU11- DBSU11-DBSU10-DBSU9-DBSU9-DBSU8-DBSU8
but i am getting only 11-11-10-8-9-8-9 Which is wrong
Hey this C9.1.20. should also be sorted I mean C9.1.20.1DBSU12 is less than C9.1.20.2DBSU1
Please help me out as soon as you can . I need it at the earliest
Thanks
Sandeep
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
I am trying to attach tape drive to sun V890 running Solaris 9 on it.
I have installed HBA(qlogic) in slot 1 of 0-8 slots and booted the system. I do not see HBAin prtdiag output. The tape drive is not attached to HBA. The tape drive I am going to attach is Sony AIT3.
1.How can I make... (3 Replies)
Discussion started by: sriny
3 Replies
2. Shell Programming and Scripting
I have the following file. Its an output from a du command with certain conditions attached to it. I used du -ah as I need the 1st column to look human readable. sort -nr is not giving me the output I need, nor is sort -dr. Please help out.
cat testout
121K ./OMautomation/pvd
14M ... (6 Replies)
Discussion started by: vivek.bharadwaj
6 Replies
3. Shell Programming and Scripting
Let's say that I have a database that I call part ID. This database has the following grouping:
Dart1=4
Dart2=8
Dart3=12
Fork1=68
Fork2=72
Fork3=64
Bike1=28
Bike2=24
Bike3=20
Car1=44
Car2=40
Car3=36
I want to write a program that would read this database and tell me when the... (19 Replies)
Discussion started by: Ernst
19 Replies
4. UNIX for Advanced & Expert Users
hi everyone, I am kind of new to this forum. I need help in sorting this data out accordingly, I am actually doing a traceroute application and wants my AS path displayed in front of my address like this;
192.168.1.1 AS28513 AS65534 AS5089 AS5089 .... till the last AS number and if possible... (1 Reply)
Discussion started by: sam127
1 Replies
5. UNIX for Dummies Questions & Answers
Hi!
As a part of a larger script I'm using the comand du -k to get the sizes of various directories, the output is printed like this:
1324 ./images/backup/2012
1333 ./images/backup
1400 ./images
22 ./video/backup
44 ./video
1450 .
I'm trying to print it the other way around with... (2 Replies)
Discussion started by: Tralaraloro
2 Replies
6. Shell Programming and Scripting
Hi Friends,
Newbie to shell scripting. Currently i have used the below to sort data based on filenames and datestamp
$ printf '%s\n' *.dat* | sort -t. -k3,4
filename_1.dat.20120430.Z
filename_2.dat.20120430.Z
filename_3.dat.20120430.Z
filename_1.dat.20120501.Z
filename_2.dat.20120501.Z... (1 Reply)
Discussion started by: robertbrown624
1 Replies
7. Shell Programming and Scripting
I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies
8. UNIX for Beginners Questions & Answers
Hello Everyone, I need urgent help here . I need to sort a file for one of my requirement , The file has to be sorted using a key with 4 columns. Sorting is working fine on those 4 columns but when the key is matching for many rows the other columns are also getting sorted which is not required .
... (1 Reply)
Discussion started by: richa_240889
1 Replies
9. UNIX for Beginners Questions & Answers
Hello Everyone, I need help here . I need to sort a file for one of my requirement , The file has to be sorted using a key with 4 columns. Sorting is working fine on those 4 columns but when the key is matching for many rows the other columns are also getting sorted which is not required .
... (11 Replies)
Discussion started by: richa_240889
11 Replies
LEARN ABOUT DEBIAN
sort::key::types
Sort::Key::Types(3pm) User Contributed Perl Documentation Sort::Key::Types(3pm)
NAME
Sort::Key::Types - handle Sort::Key data types
SYNOPSIS
use Sort::Key::Types qw(register_type);
register_type(Color => sub { $_->R, $_->G, $_->B }, qw(int, int, int));
# you better
# use Sort::Key::Register ...
DESCRIPTION
The Sort::Key family of modules can be extended to support new key types using this module (or the more friendly Sort::Key::Register).
FUNCTIONS
The following functions are provided:
Sort::Key::register_type($name, &gensubkeys, @subkeystypes)
registers a new datatype named $name defining how to convert it to a multikey.
&gensubkeys should convert the object of type $name passed on $_ to a list of values composing the multikey.
@subkeystypes is the list of types for the generated multikeys.
For instance:
Sort::Key::Types::register_type
'Person',
sub { $_->surname,
$_->name,
$_->middlename },
qw(str str str);
Sort::Key::Types::register_type
'Color',
sub { $_->R, $_->G, $_->B },
qw(int int int);
Once a datatype has been registered it can be used in the same way as types supported natively, even for defining new types, i.e.:
Sort::Key::Types::register_type
'Family',
sub { $_->father, $_->mother },
qw(Person Person);
SEE ALSO
Sort::Key, Sort::Key::Merger, Sort::Key::Register.
COPYRIGHT AND LICENSE
Copyright (C) 2005-2007 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 2012-06-30 Sort::Key::Types(3pm)