Hi,
Need awk help to group and print lines to format the output as shown below
INPUT FORMAT
set echo on
set heading on
set spool on
/* SCHEMA1 */ CREATE TABLE T1;
/* SCHEMA1 */ CREATE TABLE T2;
/* SCHEMA1 */ CREATE TABLE T3;
/* SCHEMA1 */ CREATE TABLE T4;
/* SCHEMA1 */ CREATE TABLE T5;... (5 Replies)
Hi,
Suppose if i am having a file with following records as given below.
5555
6756
5555
4555
4555
6767
how can i get the count of each record using AWK.
Eg:5555 count should be 2
4555 count should be 2
6767 count should be 1
... (5 Replies)
Hi
I have a file in this format:
...
04/May/2009 16
04/May/2009 1
05/May/2009 3
05/May/2009 5
06/May/2009 1
06/May/2009 3
...
I need to sum for every day, What is the best way?
Thanks all (2 Replies)
I have a file has following records
policy glb id 1233 name Permit ping from "One" to "Second" "Address1" "Any" "ICMP-ANY" permit
policy id 999251
service "snmp-udp"
exit
policy glb id 1234 name Permit telnet from "One" to "Second" "Address2" "Any" "TCP-ANY" permit
policy id 1234... (3 Replies)
Hi,
I have file with below format and sample data - File is pipe delimited
Col1|col2|Account|Bal1|Bal2
1|2|1|10|5
1|2|2|10|2
1|3|3|10|3
I want output as
SUM|1|2|2|20|7
SUM|1|3|1|10|3
Can anyone give me awk command (4 Replies)
How do i print the last record of a group in a file ?
For example, I have a file like this :
cat txt
cucm1,location1,1,2,3
cucm2,location1,3,4,5
cucm1,location1,10,20,30
cucm2,location2,30,40,50
I am expecting a command that would print the last record of the group.
For example, ... (2 Replies)
Hi Gurus,
I'm scratching my head over and over and couldn't find the the right way to compose this AWK properly - PLEASE HELP :confused:
Input:
c,d,e,CLICK
a,b,c,CLICK
a,b,c,CONV
c,d,e,CLICK
a,b,c,CLICK
a,b,c,CLICK
a,b,c,CONV
b,c,d,CLICK
c,d,e,CLICK
c,d,e,CLICK
b,c,d,CONV... (6 Replies)
hi all
below is the input file contains a code followed by amount
input file
345,5.86
346,20.58
399,10.00
400,12.00
i need the output in the following way outputfile
totalsumof345and346,26.44
totalsumof399and400,22.00 (10 Replies)
file:
Data has to be grouped on 1st field; And in each group, print 2nd field IF 1st field doesn't match with any of the values in 2nd field..
o/p to be:
I ended up writing as below, any help ??
awk -F, '!($1 in a){a++;}END{for (i in a)print i}' file (3 Replies)