Sponsored Content
Full Discussion: AWK aggregate records
Top Forums UNIX for Advanced & Expert Users AWK aggregate records Post 302229606 by otheus on Wednesday 27th of August 2008 09:39:26 AM
Old 08-27-2008
I need a little more info. After aggregating, what do you want to print out? When there's no aggregation, do you want to print out anything?

Here's a start:
Code:
awk -F\| '
  VAR && $7 <= VAR { AGGREGATE HERE; VAR=0; next; }
  $9 == 2 && $1 == $4 && $1==$5 { VAR=$7+$8+2; next; }
  { PRINT OTHER LINES HERE }
'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

aggregate ethernet ports under Solaris

I have been looking for info on how to aggregate 2 ore 3 NIC's into into one big pipe. Any advice would be appreciated. -Chuck (4 Replies)
Discussion started by: 98_1LE
4 Replies

2. Shell Programming and Scripting

awk - Number of records

Hi, Is it possible to find the total number of records processed by awk at begining. NR gives the value at the end. Is there any variable available to find the value at the begining? Thanks ---------- Suman (1 Reply)
Discussion started by: suman_jakkula
1 Replies

3. UNIX Desktop Questions & Answers

Aggregate title to an archive.log

Hello how are you, i have a question i have a file ale.log and i want to agregate a title and later a space when the text is over and put another title (when the text is over) how can i do this? thank you Example Last ------>(Title) i want to agregate pupu pupu pupu pupu... (1 Reply)
Discussion started by: enkei17
1 Replies

4. IP Networking

Aggregate two internet connections

Hi I have a question related to load balancing.I have two separate internet connections with 2Mbps speed and i would like to aggregate this two connections intro one connection with 4Mbps.Is it possible to do that, to put a Linux or Unix machine as a gateway?I read some stuff to split the... (3 Replies)
Discussion started by: tafil
3 Replies

5. Shell Programming and Scripting

Awk Multiple Files & Aggregate

file 1: 70|236|PPS|0501011818|mms|20090706|001452|00000024|2|0000000000000000|00000|0000000000|0000000000|40948000|1 70|236|PPS|0501020076|mms|20090705|204408|00000019|2|0000000000000000|00000|0000000000|0000000000|40947930|1... (3 Replies)
Discussion started by: magedfawzy
3 Replies

6. Shell Programming and Scripting

Skip first and last n records with awk

Hi, I have an awk code that reads an input file, checks the 4th column and tells if its fine. #!/bin/ksh { if ($4 == 0) print "fine" else print "some problem" }' FILENAME My problem is that, I dont want to check the first 3 and last 3 lines. This can be hard coded by using BEGIN and END... (9 Replies)
Discussion started by: gotam
9 Replies

7. Shell Programming and Scripting

simple aggregate task

Hi experts, I need an help on the task below. INPUT: values separated by the tab,first row is the header 20110609 AS A 300.5000 20110609 AS R 200.5000 20110609 BR A 111.5000 20110609 BR R 222.5000 20110610 AS A 100.5500 20110610 AS ... (2 Replies)
Discussion started by: hernand
2 Replies

8. Shell Programming and Scripting

Common records using AWK

Hi, To be honest, I am really impressed and amazed at the pace I find solutions for un-solved coding mysteries in this forum. I have a file like this input1.txt x y z 1 2 3 a b c 4 -3 7 k l m n 0 p 1 2 a b c 4 input2 x y z 9 0 -1 a b c 0 6 9 k l m 8 o p 1 2 a f x 9 Output... (9 Replies)
Discussion started by: jacobs.smith
9 Replies

9. Solaris

IPMP over aggregate in Solaris 11

hi all, i start with solaris 11 and i am disapointed by the change on ip managing. i want to set a ipmp over tow aggregate but i dont find any doc and i am lost with the new commande switch1 net0 aggregate1 | net1 aggregate1 |-----| |... (1 Reply)
Discussion started by: sylvain
1 Replies

10. Shell Programming and Scripting

Aggregate data within the file

Guys, I need to roll up data within the file and build a new file with the output and the same format as the original file. The data should be rolled up for each unique combination of ord,line,date and hour.. The last column appr is always " " Below is the format Original File: ... (8 Replies)
Discussion started by: venky338
8 Replies
AGGREGATE-IOS(1)                                              General Commands Manual                                             AGGREGATE-IOS(1)

NAME
aggregate-ios - optimise a concatenated set of cisco/IOS prefix filters to help make them nice and short. SYNOPSIS
aggregate-ios <source_config >optimised_config DESCRIPTION
Takes cisco IOS configuration on stdin, and optimises any prefix filters found using aggregate(1). Optimised filters are produced on std- out. OPTIONS
None. DIAGNOSTICS
Any diagnostics produced by aggregate(1) are passed through on stderr. EXAMPLES
The following configuration fragment: ip prefix-list AS65530 description Foo, Inc ip prefix-list AS65530 permit 10.1.0.0/16 ip prefix-list AS65530 permit 10.2.0.0/16 ip prefix-list AS65530 permit 10.2.1.0/24 ip prefix-list AS65530 permit 10.3.0.0/16 ip prefix-list AS65531 description Bar.Com ip prefix-list AS65531 seq 5 permit 192.168.1.0/24 ip prefix-list AS65531 seq 10 permit 192.168.2.0/24 ip prefix-list AS65531 seq 15 permit 192.168.0.0/19 is optimised as follows: ip prefix-list AS65530 permit 10.1.0.0/16 le 24 ip prefix-list AS65530 permit 10.2.0.0/15 le 24 ip prefix-list AS65531 permit 192.168.0.0/19 le 24 SEE ALSO
aggregate(1) HISTORY
Aggregate-ios was written by Joe Abley <jabley@mfnx.net>. BUGS
All those in aggregate(1) and then some :) Joe Abley 2000 November 27 AGGREGATE-IOS(1)
All times are GMT -4. The time now is 11:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy