my data.file:
1 2 3
3 2 1
3 5 8
4 9 11
3 3 30
I sort it by the 3rd column:
sort -k3b,3 data.file I have :
3 2 1
4 9 11
1 2 3
3 3 30
3 5 8
How can I sort the 3rd column with the +n command? (2 Replies)
Hi, Iam new to unix. I have one input file .
Input file :
ID1~Name1~Place1
ID2~Name2~Place2
ID3~Name3~Place3
I need output such that only first column should change to fixed width column of 15 characters of length.
Output File:
ID1<<12 spaces>>Name1~Place1
ID2<<12... (5 Replies)
Hi,
This is my input file:
ali 5 usa abc
abu 4 uk bca
alan 6 brazil bac
pinky 10 utah sdc
My desired output:
pinky 10 utah sdc
alan 6 brazil bac
ali 5 usa abc
abu 4 uk bca
Based on the column two, I want to do the descending order and print out other related column at the... (3 Replies)
Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2
file 1 sample
SNDK 80004C101 AT
XLNX 983919101 BB
NETL 64118B100 BS
AMD 007903107 CC
KLAC 482480100 DC
TER 880770102 KATS
ATHR 04743P108 KATS... (7 Replies)
dear friends I want to convert four column data to one column data. For example:
from
1, 2, 3, 4
5, 6, 7, 8to
1
2
3
4
5
6
7
8what is the general command for that type of convertion.
thanks (5 Replies)
Dear All,
I have a data file input.csv like below. (Only five column shown here for example.)
Data1,StepNo,Data2,Data3,Data4
2,1,3,4,5
3,1,5,6,7
3,2,4,5,6
5,3,5,5,6
From this I want the below output
Data1,StepNo,Data2,Data3,Data4
2,1,3,4,5
3,1,5,6,7
where the second column... (4 Replies)
This is my input file :
# cat list 20130430121600, cucm, location,76,2 20130430121600,cucm1,location1,76,4 20130430122000,cucm,location,80,8 20130430122000,cucm1,location1,90,8 20130430140000,cucm1,location1,87,11 20130430140000, cucm,location,67,9
This is the required output
... (1 Reply)
How to sort the following output based on lowest to highest BE?
The following sort does not work.
$ sort -t. -k1,1n -k2,2n bfd.txt
BE31.116 0s 0s DOWN DAMP
BE31.116 0s 0s DOWN DAMP
BE31.117 0s 0s ... (7 Replies)
Discussion started by: sand1234
7 Replies
LEARN ABOUT DEBIAN
data::pager
Data::Pager(3pm) User Contributed Perl Documentation Data::Pager(3pm)NAME
Data::Pager - flexible data pager
SYNOPSIS
use Data::Pager;
my $pager = Data::Pager->new({
current => 100,
perpage => 10,
offset => 5,
limit => 2000,
});
#~ accessors:
$pager->current; # 100
$pager->next; # 101
$pager->prev; # 99
$pager->limit; # 2000
$pager->start; # 1 # not typical start of a programmer
$pager->final; #
# 400 (which denotes 2000 / 5 pager links)
$pager->end; # /
$pager->from; # 495 (may serve in SQL LIMIT clause)
$pager->to; # 500 (may serve in SQL LIMIT clause)
$pager->list; # 95 96 97 98 99 100 101 102 103 104 105
DESCRIPTION
This class implements the familiar pager where the current position is centered.
CONSTRUCTOR
new
my $pager = Data::Pager->new({
current => 1, # this is the current pager position
perpage => 10, # the pager consists of this number of links (defaults to 10)
offset => 5, # this is the number of results (fetched from the DB for example) per result
limit => 100, # how far is the pager allowed
});
# sample output from html table:
id ... ..... ...
1. ... ..... ...
2. ... ..... ...
3. ... ..... ...
4. ... ..... ...
5. ... ..... ...
1 2 3 4 5 6 7 8 9 10
Returns object or undef if current position is beyond the limit.
METHODS
current
$pager->current();
Returns the current pager position.
set_current($digit)
$pager->set_current(850);
$pager->set_current(850)->next();
Sets the current pager position. Returns the pager object on succes, undef on false.
next
Returns the next pager position or undef if this is the last one.
prev
Returns the previous pager position or undef if this is the first one.
start
Returns 1 - the start pager position.
end
Returns the end pager position.
first
Returns the first pager position for this result set.
last
Returns the last pager position for this result set.
from
'1' => {
'to' => 5,
'next' => 2,
'prev' => undef,
'from' => 0
},
'2' => {
'to' => 10,
'next' => 3,
'prev' => 1,
'from' => 5
},
...
Returns the start result this pager position refers to.
to
Returns the end result this pager position refers to.
list
@_ = $pager->list;
$_ = $pager->list;
Returns the pager links for this result set. In list context returns the resulting list. In scalar context returns reference to the
resulting list.
# note the alignment
$pager->set_current(10);
print $pager->list; # 6 7 8 9 [10] 11 12 13 14 15
$pager->set_current(33);
print $pager->list; # 28 29 30 31 32 [33] 34 35 36 37 38
SEE ALSO
Data::Page
BUGS
What BUGS?
AUTHOR
Vidul Nikolaev Petrov, vidul@cpan.org
COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.10.0 2006-04-04 Data::Pager(3pm)