Sponsored Content
Top Forums Shell Programming and Scripting Help building the logic for a script Post 302213071 by fahadaizaz on Wednesday 9th of July 2008 05:55:09 AM
Old 07-09-2008
@ quine

1) Is this all being recorded moment by moment in one file like a log, or are the "USE" records in a separate file?
Code:
Basically yes this is recorded moment by moment. But most of the time the file contains the polling information that is not required. 
Point is the file contains this data as well as other garbage stuff which is not required. 
Therefore you can consider the file as a static file which contains all the valid records and garbage values/lines.

2) It makes sense that if there is a USE record where there has been no line record it would be an error.
Code:
I can grep the data that i require into a seperate file meaning, the two lines
INFO line [ msisdn = 133762, bonus = 56284, total usage = 562842 ]

and

2008:07:08 07:03:20.655 (tid 4) INFO AIR credit operation success [ msisdn = 773210]

and do the processing.


3) Can you get two "line records" with the same msisdn without a USE record in between? If yes, you must account for this. How about the reverse? Two or mor uses for each recording? Either that is an error too, or you add up the credits or something, etc.
Code:
You see there is a chance that the two records INFO line and INFO AIR credit operation success may not match.
Because what i want to achieve is that the "recorded bonus (INFO line)" and the "credit operation success" are equal. 
if any thing is missing just put it into an error file.


4) What happens if a line record never gets used? That is, how long do you hold (store) un-used "line records" before they become errors (if they ever do)?
Code:
This is why i am creating this script to see that both operations that is recording of bonuses and posting them are consistant. 
Any descripencies could be seen in the error file.



@snowline84

The lines we need to check are:

INFO line
and
INFO AIR credit operation success
 

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help required on building the logic

Hi, Can anyone please help me on building the logic for writing a shell script which can delete blank lines from a file and count the number of duplicate lines in a file. Thanks, Indra (2 Replies)
Discussion started by: igandu
2 Replies

2. Shell Programming and Scripting

Need help in building Unix script

Hi all, We have a requirement like we need to create a program which will change a particular string in the file. For example +=KA1238767 1121 3344645 686943 22356 01 567893 12435 12121 983627 121 1092 091217 02 may be for engine failure In the above file we need to change the bold string... (2 Replies)
Discussion started by: susant.igate
2 Replies
IO::Async::Protocol::LineStream(3pm)			User Contributed Perl Documentation		      IO::Async::Protocol::LineStream(3pm)

NAME
"IO::Async::Protocol::LineStream" - stream-based protocols using lines of text SYNOPSIS
Most likely this class will be subclassed to implement a particular network protocol. package Net::Async::HelloWorld; use strict; use warnings; use base qw( IO::Async::Protocol::LineStream ); sub on_read_line { my $self = shift; my ( $line ) = @_; if( $line =~ m/^HELLO (.*)/ ) { my $name = $1; $self->invoke_event( on_hello => $name ); } } sub send_hello { my $self = shift; my ( $name ) = @_; $self->write_line( "HELLO $name" ); } This small example elides such details as error handling, which a real protocol implementation would be likely to contain. DESCRIPTION
EVENTS
The following events are invoked, either using subclass methods or CODE references in parameters: on_read_line $line Invoked when a new complete line of input is received. PARAMETERS
The following named parameters may be passed to "new" or "configure": on_read_line => CODE CODE reference for the "on_read_line" event. METHODS
$lineprotocol->write_line( $text ) Writes a line of text to the transport stream. The text will have the end-of-line marker appended to it; $text should not end with it. AUTHOR
Paul Evans <leonerd@leonerd.org.uk> perl v5.14.2 2012-10-24 IO::Async::Protocol::LineStream(3pm)
All times are GMT -4. The time now is 09:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy