Hi,
I want a list of entries in 3 space delimited columns. I want to sort entries based on the very first column. Rows can't be changed. For example:
If I have...
Abc Abc Acc
Bca Bda Bdd
Cab Cab Cbc
Dbc Dca Dda
Abc Abc Acc
the output should be...
Abc Abc Acc
Abc Abc Acc
Bca... (7 Replies)
Hi gang.
I'm using a unix/mac system and i'm trying to sort a file (more than 1,000,000 lines).
chr1 100000965 100001001 -
chr1 100002155 100002191 +
chr1 100002165 100002201 +
chr1 100002525 100002561 -
chr1 10000364 ... (2 Replies)
Hi,
I have a requirement whereby I have to sort a flat file based on Multiple Columns (similar to ORDER BY Clause of Oracle). I am getting 10 columns in the flat file and I want the file to be sorted on 1st, 3rd, 4th, 7th and 9th columns in ascending order. The flat file is pipe seperated.
Any... (15 Replies)
Hi Friends
I have the following input data in 2 columns.
SNo 1
I1 Value
I2 Value
I3 Value
SNo 2
I4 Value
I5 Value
I6 Value
I7 Value
SNo 3
I8 Value
I9 Value
...............
................
SNo N (1 Reply)
Hi,
I have two files, one of which I would like to sort based on the order of the data in the second. I would like to do this using a simple unix statement.
My two files as follows:
File 1:
12345 1 2 2 2 0 0
12349 0 0 2 2 1 2
12350 1 2 1 2 2 2
.
.
.
File2:
12350... (3 Replies)
Hi All,
I have some data like below.
Step1,Param1,Param2,Param3
1,2,3,4
2,3,4,5
2,4,5,6
3,0,1,2
3,0,0,0
3,2,1,3
........
so on
Where I need to find the median(arithmetic) of each column from Param1...to..Param3 for each set of Step1 values.
(Sort each specific column, if the... (5 Replies)
Hi All,
I need the modification for the below mentioned code (found in one more post https://www.unix.com/shell-programming-scripting/27161-script-generate-average-values.html) to find the average values for all the columns(but for a specific rows) and print the averages side by side.
I have... (4 Replies)
I have log files with following format -
YYYY/MM/DD HH:mm:ss.msec|field2|filed3| log message
Now the message itself can be multi line message containing new line character.
for e.g.
2013/02/05 15:33:12.234|abc|xyz| This is first single line message.
2013/02/05 15:33:12.786|abc|xyz| This... (6 Replies)
Perl::Critic::Policy::Subroutines::ProhibitReturnSort(3pUser Contributed Perl DocumentatPerl::Critic::Policy::Subroutines::ProhibitReturnSort(3pm)NAME
Perl::Critic::Policy::Subroutines::ProhibitReturnSort - Behavior of "sort" is not defined if called in scalar context.
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
The behavior of the builtin "sort" function is not defined if called in scalar context. So if you write a subroutine that directly
"return"s the result of a "sort" operation, then you code will behave unpredictably if someone calls your subroutine in a scalar context.
This Policy emits a violation if the "return" keyword is directly followed by the "sort" function. To safely return a sorted list of
values from a subroutine, you should assign the sorted values to a temporary variable first. For example:
sub frobulate {
return sort @list; # not ok!
@sorted_list = sort @list;
return @sort # ok
}
KNOWN BUGS
This Policy is not sensitive to the "wantarray" function. So the following code would generate a false violation:
sub frobulate {
if (wantarray) {
return sort @list;
}
else{
return join @list;
}
}
CONFIGURATION
This Policy is not configurable except for the standard options.
CREDITS
This Policy was suggested by Ulrich Wisser and the <http://iis.se> team.
AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license
can be found in the LICENSE file included with this module.
perl v5.14.2 2012-06-07 Perl::Critic::Policy::Subroutines::ProhibitReturnSort(3pm)