Sponsored Content
Full Discussion: Parsing a file with AWK
Top Forums Shell Programming and Scripting Parsing a file with AWK Post 302515646 by Corona688 on Wednesday 20th of April 2011 03:06:03 PM
Old 04-20-2011
I'm having trouble seeing the pattern. why do you care about CNJ R1: but not Group:, why do you care about RSet 1 but not RSet 10?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

parsing file through awk

hi, how can i achieve this in awk CON Controllers Department R abcuser usernamedesc1 R defuser usernamedesc2 R ... (13 Replies)
Discussion started by: bbeugie
13 Replies

2. Shell Programming and Scripting

AWK and Magic with file parsing

Hi, I have a input file like this TH2TH2867Y NOW33332106Yo You Baby TH2TH3867Y NOW33332106No Way Out TH2TH9867Y NOW33332106Can't find it TJ2TJ2872N WOW33332017sure thing alas TJ2TJ3872N WOW33332017the sky rocks TJ2TJ4872N WOW33332017nothing else matters TJ2TJ5872N WOW33332017you know... (1 Reply)
Discussion started by: devtakh
1 Replies

3. Shell Programming and Scripting

awk and file parsing

Hi, I have a input file like this TH2TH2867Y NOW33332106Yo You Baby TH2TH3867Y NOW33332106No Way Out TH2TH9867Y NOW33332106Can't find it TJ2TJ2872N WOW33332017sure thing alas TJ2TJ3872N WOW33332017the sky rocks TJ2TJ4872N WOW33332017nothing else matters ... (4 Replies)
Discussion started by: devtakh
4 Replies

4. Shell Programming and Scripting

Parsing a file (sed/awk?)

Hello people, newbie question. I'm trying to parse these type of file 1 "CAR " " C1 " " " 6 0 C1 2 "CAR " " O1A" " " 8 0 O1A 3 "CAR " " O1B" " " 8 -1 O1B 4 "CAR " " C2 " " " 6 0 C2 5 "CAR " " C3 " " " 6 ... (10 Replies)
Discussion started by: aristegui
10 Replies

5. Shell Programming and Scripting

awk/sed for parsing file

Hi All, I have a log file like this E Mon Oct 06 00:17:08 2008 xxx2 cm:10614 fm_pi2_svc_iptv_purchase.c:149 1:pin_deferred_act:10601:11:169:1223245028:16 pi2_op_svc_iptv_purchase error <location=PIN_ERRLOC_FM:5 class=PIN_ERRCLASS_SYSTEM_DETERMINATE:1... (10 Replies)
Discussion started by: subin_bala
10 Replies

6. UNIX for Advanced & Expert Users

Parsing through a file with awk/sed

I don't necessary have a problem, as I have a solution. It is just that there may be a better solution. GOAL: Part one: Parse data from a file using the "\" as a delimiter and extracting only the last delimiter. Part two: Parse same file and extract everything but the last delimited item. ... (8 Replies)
Discussion started by: OrangeYaGlad
8 Replies

7. Shell Programming and Scripting

Help in file parsing with awk

Hi, I have a data set as shown below: 09e757fd,22727,2012-03-01,text1,text2,to 3fd0cae7,310,2012-03-01,text3,text4,to 3fd0cae7,310,2012-03-01,text3,text5,to 3fd0cae7,311,2012-03-01,text7,text10,cc 3fd0cae7,311,2012-03-01,text7,text11,to 3fd0cae7,312,2012-03-01,text8,text15,to... (3 Replies)
Discussion started by: shekhar2010us
3 Replies

8. Shell Programming and Scripting

AWK? parsing /etc/passwd file.

Hello guys, please help me to make simple script for parsing passwd file. I have many passwd files from our servers, named server1.pass, server2.pass etc.. so for server in `ls *.pass` i need to print these rows: server1;root:!:0:0::/root:/usr/bin/ksh... (7 Replies)
Discussion started by: rubico
7 Replies

9. Shell Programming and Scripting

awk parsing file

Looking to parse a file to remove the duplicates and get only few fields and uniq rows. input.tx Loc (TC) ID : ssfad_fs Serial : PIC002340098 ... (8 Replies)
Discussion started by: shunya
8 Replies

10. Shell Programming and Scripting

Parsing a file name with awk

I have a command to print out the top 5 most cpu intensive commands: ps aux --sort=-%cpu --no-headers I would like to make a printout containing only the parsed file name. So, I want to turn this: $ ps aux --sort=-%cpu --no-headers user 24883 4.3 1.7 2010436 131440 ? Sl ... (2 Replies)
Discussion started by: bedtime
2 Replies
Aggregator(3pm) 					  LogReport's Lire Documentation					   Aggregator(3pm)

NAME
Lire::Aggregator - Base class for all aggregator operators SYNOPSIS
use base qw/ Lire::Aggregator /; DESCRIPTION
The Lire::Aggregator is the base class for all the aggregator operators available in Lire. It implements behavior common to all the aggregator as well as defining some methods that need to be implemented by subclasses. In Lire, an aggregator is an operator which will group DLF records. Other operators like avg or sum will then compute values in these groups of DLF records. Aggregators can be nested to compute values on hierarchical groups. METHODS
ops( [$new_ops] ) Returns the operators contained in this aggregator. The returned value is a reference to an array of Lire::ReportOperator objects. If the $new_ops is used, it changes the content of this aggragagor to these new values. $new_ops should be a reference to an array containing Lire::ReportOperator objects. op_by_name( $name ) Returns the operator named $name in this aggregator. An exception is thrown if there is no such operator. is_name_defined( $name ) Returns true if this aggregator contains an operator named $name. METHODS FOR SUBCLASSES
print( $fh, $pfx ) This methods implements the print() method required by Lire::ReportOpetor. It prints the XML element named after op() and takes care of writing the XML representation of all the children operation. It also takes care of writing the name and label attribute. Other attributes can be added to the XML element by overriding the xml_attrs() method. Other children elements could be added to the output stream by overriding the print_content() method. xml_attrs() This method can be used to write additional XML attributes. The returned string will be output in the XML element. print_content( $fh, $pfx ) This method prints the operators contained in this aggregator. It can be overriden to add some other elements. create_group_info( $info ) FIXME Subclasses have to override the create_categorical_info() method for this implementation. create_categorical_info( $info ) This method is used by the implementation of create_group_info() to add the categorical ColumnInfo provided by the aggregator. create_entries( $subreport ) This method is used by Lire::ReportSpec to fill the Lire::Report::Subreport with the entries when creating the subreport. The $subreport parameter contains the Subreport object to which the subreport's entries should get added. This method will only be called on the top-level aggregator in the report. build_query( $query ) FIXME set_group_summary( $group, $row ) FIXME create_entry( $group, $row ) FIXME MERGING AGGRATOR API
It defines additional methods required by Aggregator implementation to be able to merge data.. The base Aggregator implementation takes care of merging the summary information included in the Lire XML reports. The merging specifics to the aggregator should be implemented in the init_agggregator_data(), update_aggregator_data() and end_aggregator_data() methods. This class also takes care of the case when the aggregator is the top-level aggregator, that is the immediate child of the report-calc-spec element in the report specification), IMPLEMENTATION OF Lire::ReportOperator MERGING METHODS init_merge( $period_start, $period_end ) The default implementation makes sure that all contained operators are inited. Implementation of specific aggregator must chain up to this method, if they override it. end_merge() The default implementation makes sure that all operators gets the end_report() event. Subclasses should chain up to this method, if they override it. init_group_data() The Aggregator implements init_group_data(). It takes care of computing the summary information. Subclass does the equivalent in init_aggregator_data(). merge_group_data( $value, $data ) The Aggregator implements merge_group_data(). It takes care of merging the summary information. Subclass does the equivalent in merge_aggregator_data(). end_group_data($data) The Aggregator implements end_group_data(). It takes care of computing the summary information. Subclass does the equivalent in end_aggregator_data(). add_entry_value( $entry, $data ) This method will make sure that the entries of nested aggregator are wrapped up in a Lire::Report::Group element. There is no reason to override that method since the entries of the aggregator are added in the create_group_entries() method. METHODS THAT SHOULD BE IMPLEMENTED BY SUBCLASSES FOR MERGING
init_aggregator_data() This is the equivalent of init_group_data() and is called from Aggregator's implementation of init_group_data(). merge_aggregator_data( $value, $data ) This method is the equivalent than merge_group_data() and is called from Aggregator's implementation of merge_group_data(). end_aggregator_data( $data ) This method is the equivalent of the end_group_data() and is called from Aggregator's implementation of end_group_data(). create_group_entries( $group, $data ) In this method, the aggregator should add one Lire::Report::Entry object for every group merged by the aggregator. $group is an instance of Lire::Report::Group to which the entries should be added. $data is the data structure returned by init_group_data() for the group in which the aggregator is nested (or the only structure that was created when the aggregator is the top- level aggregator). In this method, the aggregator must make sure to call add_entry_value() on its contained operators for each entry created. SEE ALSO
Lire::ReportSpec(3pm), Lire::Aggregate(3pm), Lire::ReportOperator(3pm), Lire::Group(3pm), Lire::Timegroup(3pm), Lire::Timeslot(3pm), Lire::Rangegroup(3pm) AUTHORS
Francis J. Lacoste <flacoste@logreport.org> Wolgang Sourdeau <wsourdeau@logreport.org> VERSION
$Id: Aggregator.pm,v 1.29 2006/07/23 13:16:27 vanbaal Exp $ COPYRIGHT
Copyright (C) 2001-2004 Stichting LogReport Foundation LogReport@LogReport.org This file is part of Lire. Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. Lire 2.1.1 2006-07-23 Aggregator(3pm)
All times are GMT -4. The time now is 03:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy