Hi Gurus,
I have a file
1|usa|hh
2|usa|ll
3|usa|vg
4|usa|vg
5|usa|vg
6|usa|vg
7|usa|ll
8|uk|nn
9|uk|bb
10|uk|bb
11|kuwait|mm
12|kuwait|jkj
13|kuwait|mm
14|dubai|hh
I want to group by last two columns and get the last two recs and count. (3 Replies)
Hi all,
I have created a script which adding two columns and removing two columns for all files.
Filename: Cust_information_1200_201010.txt
Source Data:
"1","Cust information","123","106001","street","1-203 high street"
"1","Cust information","124","105001","street","1-203 high street"
... (0 Replies)
Hi
I have the input file following like this
"AIX"
"AIX 6.0"
"AIX 7.0"
"Redhat 8"
"Redhat 9"
"Redhat 5.0 Enterprise Linux"
"Sun Solaris 9"
"Sun Solaris 10",
"Sun Microsystems"
"Oracle"
.................................Like this 2000 lines
I need to convert this input into... (5 Replies)
Hi All,
I have two .csv's
input.csv having values as (7 columns)
ABC,A19907103,ABC DEV YUNG,2.17,1000,2157,07/07/2006
XYZ,H00213850,MM TRUP HILL,38.38,580,23308,31/08/2010
output.csv having (25 columns)
A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y... (4 Replies)
Hi All,
I have a pipe seperated file. I need to add the values in second and third columns with group by on first column.
MYFILE_28012012_1115|47|173.90
MYFILE_28012012_1115|4|0.00
MYFILE_28012012_1115|6|22.20
MYFILE_28012012_1116|47|173.90
MYFILE_28012012_1116|4|0.00... (3 Replies)
My File looks like:
"|" -> Field separator
A|B|C|100|1000
D|E|F|1|2
G|H|I|0|7
D|E|F|1|2
A|B|C|10|10000
G|H|I|0|7
A|B|C|1|100
D|E|F|1|2
I need to do a SUM on Col. 5 and Col.6 by grouping on Col 1,2 & 3
My expected output is:
A|B|C|111|11100 (2 Replies)
Hi experts,
I want to group by average, for multiple columns starting column $7 until NF,
group by ($1-$5), please help
For just 7th column, I can do
awk '
NR>1{
arr += $7
count += 1
}
END{
for (a in arr) {
print a, arr/count
... (10 Replies)
Dear Experts,
I have input file which is comma separated, has 4 columns like below,
BRAND,COUNTRY,MODEL,COUNT
NIKE,USA,DUMMY,5
NIKE,USA,ORIGINAL,10
PUMA,FRANCE,DUMMY,20
PUMA,FRANCE,ORIGINAL,15
ADIDAS,ITALY,DUMMY,50
ADIDAS,ITALY,ORIGINAL,50
SPIKE,CHINA,DUMMY,1O
And expected output add... (2 Replies)
As part of some report generation, I've written a script to fetch the values from DB. But, unluckily, for certain Time ranges(1-9.99,10-19.99 etc), I don't have data in DB.
In such cases, I would like to write zero (0) instead of empty. The desired output will be exported to csv file.
... (1 Reply)
Discussion started by: kumar_karpuram
1 Replies
LEARN ABOUT DEBIAN
class::dbi::columngrouper
Class::DBI::ColumnGrouper(3pm) User Contributed Perl Documentation Class::DBI::ColumnGrouper(3pm)NAME
Class::DBI::ColumnGrouper - Columns and Column Groups
SYNOPSIS
my $colg = Class::DBI::ColumnGrouper->new;
$colg->add_group(People => qw/star director producer/);
my @cols = $colg->group_cols($group);
my @all = $colg->all_columns;
my @pri_col = $colg->primary;
my @essential_cols = $colg->essential;
DESCRIPTION
Each Class::DBI class maintains a list of its columns as class data. This provides an interface to that. You probably don't want to be
dealing with this directly.
METHODS
new
my $colg = Class::DBI::ColumnGrouper->new;
A new blank ColumnnGrouper object.
clone
my $colg2 = $colg->clone;
Clone an existing ColumnGrouper.
add_column / find_column
$colg->add_column($name);
my Class::DBI::Column $col = $colg->find_column($name);
Add or return a Column object for the given column name.
add_group
$colg->add_group(People => qw/star director producer/);
This adds a list of columns as a column group.
group_cols / groups_for
my @colg = $cols->group_cols($group);
my @groups = $cols->groups_for(@cols);
This returns a list of all columns which are in the given group, or the groups a given column is in.
columns_in
my @cols = $colg->columns_in(@groups);
This returns a list of all columns which are in the given groups.
all_columns
my @all = $colg->all_columns;
This returns a list of all the real columns.
primary
my $pri_col = $colg->primary;
This returns a list of the columns in the Primary group.
essential
my @essential_cols = $colg->essential;
This returns a list of the columns in the Essential group.
perl v5.12.4 2005-09-14 Class::DBI::ColumnGrouper(3pm)