Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > sorting multiple different entries using Perl

Reply
Thread Tools

sorting multiple different entries using Perl

 
 
rusneht
Guest
Posts: n/a
 
      11-26-2003
Hi All ,
Am not sure which way to go to handle this case; hence am looking for
suggestions.

Data that I need to handle is this:

/vob/dir/file1@@/br1/10
/vob/dir/file1@@/br1/9
/vob/dir/file1@@/br1/8
/vob/dir/file2@@/br1/3
/vob/dir/file4@@/br1/7

I would like to extract from this list, not unique values, but an
output like this :

/vob/dir/file1@@/br1/10
/vob/dir/file1@@/br1/8
/vob/dir/file2@@/br1/3
/vob/dir/file4@@/br1/7

As you can see if a file has multiple entrues I would like to take
most recent and old ones from list; if only one entry for a file only
that needs to be extracted.

Any ideas or suggestions ?

--TIA,
Ramthen
 
Reply With Quote
 
 
 
 
Eric J. Roode
Guest
Posts: n/a
 
      11-29-2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

http://www.velocityreviews.com/forums/(E-Mail Removed) (rusneht) wrote in
news:(E-Mail Removed) om:

> Data that I need to handle is this:
>
> /vob/dir/file1@@/br1/10
> /vob/dir/file1@@/br1/9
> /vob/dir/file1@@/br1/8
> /vob/dir/file2@@/br1/3
> /vob/dir/file4@@/br1/7
>
> I would like to extract from this list, not unique values, but an
> output like this :
>
> /vob/dir/file1@@/br1/10
> /vob/dir/file1@@/br1/8
> /vob/dir/file2@@/br1/3
> /vob/dir/file4@@/br1/7
>
> As you can see if a file has multiple entrues I would like to take
> most recent and old ones from list; if only one entry for a file only
> that needs to be extracted.


I don't follow what you mean by "most recent and old ones". Why is br1/9
not output for file1, but br1/10 and br1/8 are?

- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBP8f8A2PeouIeTNHoEQLYLwCg8bhs/P1TYHJprT2dHIZcK4eVH7QAoJEx
HIeQB8PbUg9L1Nh3Kv8Vf/UW
=PG2u
-----END PGP SIGNATURE-----
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Picking X random entries from linked list of Y entries Don Bruder C Programming 3 08-03-2010 09:10 AM
Re: Sorting a list with entries of unequal types Peter Otten Python 3 01-29-2010 08:59 AM
Tying up Port Login table entries with Port Table Entries in CISCO SNMP John Ramsden Cisco 0 07-24-2004 04:03 PM
Sorting entries in a DBM hash by one of the variables Topher Perl 1 01-21-2004 02:28 PM
sorting by multiple criterias (sub-sorting) Tom Kirchner Perl Misc 3 10-11-2003 05:16 PM



Advertisments