Sponsored Content
Full Discussion: Sorting a list
Top Forums UNIX for Dummies Questions & Answers Sorting a list Post 302587634 by kristinu on Thursday 5th of January 2012 11:56:01 AM
Old 01-05-2012
Sorting a list

Code:
n02-z30-dsr65-terr0.50-dc0.010-16x12drw-run1.cmd
n02-z30-dsr65-terr0.50-dc0.008-16x12drw-run1.cmd
n02-z30-dsr65-terr0.50-dc0.006-16x12drw-run1.cmd
n02-z30-dsr65-terr0.50-dc0.004-16x12drw-run1.cmd
n02-z30-dsr65-terr0.50-dc0.002-16x12drw-run1.cmd
n02-z30-dsr65-terr0.50-dc0.006-16x12drw-run2.cmd
n02-z30-dsr65-terr0.50-dc0.008-16x12drw-run2.cmd
n02-z30-dsr65-terr0.50-dc0.010-16x12drw-run2.cmd
n02-z30-dsr65-terr0.50-dc0.004-16x12drw-run2.cmd
n02-z30-dsr65-terr0.50-dc0.002-16x12drw-run2.cmd
n02-z30-dsr65-terr0.50-dc0.008-16x12drw-run3.cmd
n02-z30-dsr65-terr0.50-dc0.006-16x12drw-run3.cmd
n02-z30-dsr65-terr0.50-dc0.006-16x12drw-run4.cmd
n02-z30-dsr65-terr0.50-dc0.004-16x12drw-run3.cmd
n02-z30-dsr65-terr0.50-dc0.008-16x12drw-run4.cmd
n02-z30-dsr65-terr0.50-dc0.010-16x12drw-run3.cmd
n02-z30-dsr65-terr0.50-dc0.002-16x12drw-run3.cmd
n02-z30-dsr65-terr0.50-dc0.010-16x12drw-run4.cmd
n02-z30-dsr65-terr0.50-dc0.006-16x12drw-run5.cmd
n02-z30-dsr65-terr0.50-dc0.002-16x12drw-run4.cmd
n02-z30-dsr65-terr0.50-dc0.004-16x12drw-run4.cmd
n02-z30-dsr65-terr0.50-dc0.008-16x12drw-run5.cmd
n02-z30-dsr65-terr0.50-dc0.010-16x12drw-run5.cmd
n02-z30-dsr65-terr0.50-dc0.006-16x12drw-run6.cmd
n02-z30-dsr65-terr0.50-dc0.002-16x12drw-run5.cmd
n02-z30-dsr65-terr0.50-dc0.004-16x12drw-run5.cmd
n02-z30-dsr65-terr0.50-dc0.008-16x12drw-run6.cmd
n02-z30-dsr65-terr0.50-dc0.010-16x12drw-run6.cmd
n02-z30-dsr65-terr0.50-dc0.006-16x12drw-run7.cmd
n02-z30-dsr65-terr0.50-dc0.008-16x12drw-run7.cmd
n02-z30-dsr65-terr0.50-dc0.002-16x12drw-run6.cmd
n02-z30-dsr65-terr0.50-dc0.004-16x12drw-run6.cmd

I want to sort to look like below:

First sort by field 6, then by field 5, then in increasing numbers of run tags.

Code:
n02-z30-dsr65-terr0.50-dc0.002-16x12drw-run1.cmd
n02-z30-dsr65-terr0.50-dc0.002-16x12drw-run2.cmd
n02-z30-dsr65-terr0.50-dc0.002-16x12drw-run3.cmd
n02-z30-dsr65-terr0.50-dc0.002-16x12drw-run4.cmd
n02-z30-dsr65-terr0.50-dc0.002-16x12drw-run5.cmd
n02-z30-dsr65-terr0.50-dc0.002-16x12drw-run6.cmd
 
n02-z30-dsr65-terr0.50-dc0.004-16x12drw-run1.cmd
n02-z30-dsr65-terr0.50-dc0.004-16x12drw-run2.cmd
n02-z30-dsr65-terr0.50-dc0.004-16x12drw-run3.cmd
n02-z30-dsr65-terr0.50-dc0.004-16x12drw-run4.cmd
n02-z30-dsr65-terr0.50-dc0.004-16x12drw-run5.cmd
n02-z30-dsr65-terr0.50-dc0.004-16x12drw-run6.cmd
  
n02-z30-dsr65-terr0.50-dc0.006-16x12drw-run1.cmd
n02-z30-dsr65-terr0.50-dc0.006-16x12drw-run2.cmd
n02-z30-dsr65-terr0.50-dc0.006-16x12drw-run3.cmd
n02-z30-dsr65-terr0.50-dc0.006-16x12drw-run4.cmd
n02-z30-dsr65-terr0.50-dc0.006-16x12drw-run5.cmd
n02-z30-dsr65-terr0.50-dc0.006-16x12drw-run6.cmd
n02-z30-dsr65-terr0.50-dc0.006-16x12drw-run7.cmd
  
n02-z30-dsr65-terr0.50-dc0.008-16x12drw-run1.cmd
n02-z30-dsr65-terr0.50-dc0.008-16x12drw-run2.cmd
n02-z30-dsr65-terr0.50-dc0.008-16x12drw-run3.cmd
n02-z30-dsr65-terr0.50-dc0.008-16x12drw-run4.cmd
n02-z30-dsr65-terr0.50-dc0.008-16x12drw-run5.cmd
n02-z30-dsr65-terr0.50-dc0.008-16x12drw-run6.cmd
n02-z30-dsr65-terr0.50-dc0.008-16x12drw-run7.cmd
  
n02-z30-dsr65-terr0.50-dc0.010-16x12drw-run1.cmd
n02-z30-dsr65-terr0.50-dc0.010-16x12drw-run2.cmd
n02-z30-dsr65-terr0.50-dc0.010-16x12drw-run3.cmd
n02-z30-dsr65-terr0.50-dc0.010-16x12drw-run4.cmd
n02-z30-dsr65-terr0.50-dc0.010-16x12drw-run5.cmd
n02-z30-dsr65-terr0.50-dc0.010-16x12drw-run6.cmd

 

10 More Discussions You Might Find Interesting

1. Programming

Sorting in C++..

Hi, I need to do a sorting of 2 arrays. One array contains the values of both integer and character and other array can be anything. For example: Array={'1L','2C','NULL','23L','11L','4C','10L','9C'} Array= {'01-02-13-1x','02-11-23-3s','00-12-13-5f','NULL','22k',} If any of these arrays... (6 Replies)
Discussion started by: ronix007
6 Replies

2. UNIX for Advanced & Expert Users

help with sorting sequence in Unix C:sort -t ':' +0 -1 -n +1 -2 +2 -3 -o list list

Hi List is 000|2008-07-17|556543|RTJ|35-RTGJ|EYT 465|2008-11-10|567789|GHJ|45-DGHH|ETU 533|2008-09-06|567789|GHJ|45-DGHH|ETU How does it do it? sort -t ':' +0 -1 -n +1 -2 +2 -3 -o list list (6 Replies)
Discussion started by: gurvinder
6 Replies

3. UNIX for Dummies Questions & Answers

Sorting list of files per date column

Hi all, I have a pecular issue in sorting these files (not an ls -lrt) in Solaris environment. All the below files are modified on November 4th, but I want to sort these files as per date (eg: 01May07_1623 = ddmmmyy_hhmm) Nov 4 18:27 SONYELEC00.GI22973.01May07_1623.gpg Nov 4 18:27... (10 Replies)
Discussion started by: shivaastrogun
10 Replies

4. Shell Programming and Scripting

Splitting a list @list by space delimiter so i can access it by using $list[0 ..1..2]

EDIT : This is for perl @data2 = grep(/$data/, @list_now); This gives me @data2 as Printing data2 11 testzone1 running /zones/testzone1 ***-*****-****-*****-***** native shared But I really cant access data2 by its individual elements. $data2 is the entire list, while $data,2,3...... (1 Reply)
Discussion started by: shriyer
1 Replies

5. Shell Programming and Scripting

Sorting a list of filenames but keeping the path information.

Hi All I've googled around for this and can't see a way of doing it. I have a file that contains a number of records that are layed out something like the following. /path/to/directory/that/contains/a/file/I/need/filename.pdf The path itself can vary both in terms of the names and the... (7 Replies)
Discussion started by: Bashingaway
7 Replies

6. Shell Programming and Scripting

Perl: Sorting a hash value that is a list.

Hi Folks I am very much a newbie at perl but picking it up and I'm hoping you can help. I have a file input that details all the /etc/group files in our enterprise in the following format: "<host>:<group>:<gid>:<users>" I want to parse this data display it as the following:... (9 Replies)
Discussion started by: g_string
9 Replies

7. Shell Programming and Scripting

Sorting a list

I am trying to sort a list If you walk through the list, every you have passed both website1 and website2 and get back to website1, the last lines should be collected into one line and the process should start again. The following: http://www.website1.com http://www.website1.com... (2 Replies)
Discussion started by: locoroco
2 Replies

8. Shell Programming and Scripting

Sorting a list of words one per line by their ending

Hello, My OS is Windows and therefore DOS. Hence I have no access to Unix tools. I am trying to sort a file in Urdu by the character by which it ends. Each word is on a separate line. As input, an example in English would help: fruit banana apple pear house I need the sort to be on the... (5 Replies)
Discussion started by: gimley
5 Replies

9. Shell Programming and Scripting

Sorting with list, - 2 lists next to 200

Hi I was wondering if anyone knew the best way to have files displayed by list so that they were in numerical order? the problem I am having is I am using the ls and the head command to sort a group of 500 files into manageable 133 file bunches and transfer them to another directory were they will... (4 Replies)
Discussion started by: Paul Walker
4 Replies

10. Shell Programming and Scripting

List the files after sorting based on file content

Hi, I have two pipe separated files as below: head -3 file1.txt "HD"|"Nov 11 2016 4:08AM"|"0000000018" "DT"|"240350264"|"56432" "DT"|"240350264"|"56432" head -3 file2.txt "HD"|"Nov 15 2016 2:18AM"|"0000000019" "DT"|"240350264"|"56432" "DT"|"240350264"|"56432" I want to list the... (6 Replies)
Discussion started by: Prasannag87
6 Replies
apache_mod_perl-108~358::mod_perl-2.0.7::docs::api::ApacUser:Contributed Peapache_mod_perl-108~358::mod_perl-2.0.7::docs::api::Apache2::Command(3)

NAME
Apache2::Command - Perl API for accessing Apache module command information Synopsis use Apache2::Module (); use Apache2::Command (); my $module = Apache2::Module::find_linked_module('mod_perl.c'); for (my $cmd = $module->cmds; $cmd; $cmd = $cmd->next) { $cmd->args_how(); $cmd->errmsg(); $cmd->name(); $cmd->req_override(); } Description "Apache2::Command" provides the Perl API for accessing Apache module command information API
"Apache2::Command" provides the following functions and/or methods: "args_how" What the command expects as arguments: $how = $cmd->args_how(); obj: $cmd ( "Apache2::Command object" ) ret: $how ( "Apache2::Const :cmd_how constant" ) The flag value representing the type of this command (i.e. "Apache2::Const::ITERATE", "Apache2::Const::TAKE2"). since: 2.0.00 "errmsg" Get usage message for that command, in case of syntax errors: $error = $cmd->errmsg(); obj: $cmd ( "Apache2::Command object" ) ret: $error ( string ) The error message since: 2.0.00 "name" Get the name of this command: $name = $cmd->name(); obj: $cmd ( "Apache2::Command object" ) ret: $name ( string ) The command name since: 2.0.00 "next" Get the next command in the chain of commands for this module: $next = $cmd->next(); obj: $cmd ( "Apache2::Command object" ) ret: $next ( "Apache2::Command object" ) Returns the next command in the chain for this module, "undef" for the last command. since: 2.0.00 "req_override" What overrides need to be allowed to enable this command: $override = $cmd->req_override obj: $cmd ( "Apache2::Command object" ) ret: $override ( "Apache2::Const :override constant" ) The bit mask representing the overrides this command is allowed in (i.e "Apache2::Const::OR_ALL"/"Apache2::Const::ACCESS_CONF"). since: 2.0.00 For example: use Apache2::Const -compile => qw(:override); $cmd->req_override() & Apache2::Const::OR_AUTHCFG; $cmd->req_override() & Apache2::Const::OR_LIMIT; See Also mod_perl 2.0 documentation. Copyright mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0. Authors The mod_perl development team and numerous contributors. perl v5.16.2 2011-02apache_mod_perl-108~358::mod_perl-2.0.7::docs::api::Apache2::Command(3)
All times are GMT -4. The time now is 03:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy