Sponsored Content
Full Discussion: How to get sub_total
Top Forums Shell Programming and Scripting How to get sub_total Post 302472144 by ken002 on Tuesday 16th of November 2010 11:28:22 AM
Old 11-16-2010
How to get sub_total

Hi, Unix Gurus
I have a requriement as following;
source file
Code:
ID, MONTHS,                  TOTAL_AMT
1   01,02,03                     9000
2   01,02,03,04                 8000
3   03,04,05,06,07,08,09    14000

The months column may cantains 12 months

expected target
Code:
ID BUDGET_MON  BUDGET_AMT
1      01             3000
1      02             3000
1      03             3000
2      01             2000
2      02             2000
2      03             2000
2      04             2000
3      03             2000
3      04             2000
3      05             2000
3      06             2000
3      07             2000
3      08             2000
3      09             2000

Basically, I need print out every single month and monthly budget which is total_amt divided by number of months in second column.

Thanks in advance

Last edited by Franklin52; 11-16-2010 at 01:20 PM.. Reason: Please use code tags
ken002
 
Graphics::Primitive::Insets(3pm)			User Contributed Perl Documentation			  Graphics::Primitive::Insets(3pm)

NAME
Graphics::Primitive::Insets - Space between things DESCRIPTION
Graphics::Primitive::Insets represents the amount of space that surrounds something. This object can be used to represent either padding or margins (in the CSS sense, one being inside the bounding box, the other being outside) SYNOPSIS
use Graphics::Primitive::Insets; my $insets = Graphics::Primitive::Insets->new({ top => 5, bottom => 5, left => 5, right => 5 }); METHODS
Constructor new Creates a new Graphics::Primitive::Insets. Instance Methods as_array Return these insets as an array in the form of top, right, bottom and left. bottom Set/Get the inset from the bottom. equal_to Determine if these Insets are equal to another. left Set/Get the inset from the left. right Set/Get the inset from the right. top Set/Get the inset from the top. zero Sets all the insets (top, left, bottom, right) to 0. AUTHOR
Cory Watson, "<gphat@cpan.org>" SEE ALSO
perl(1) COPYRIGHT &; LICENSE Copyright 2008-2010 by Cory G Watson. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.3 2010-08-21 Graphics::Primitive::Insets(3pm)
All times are GMT -4. The time now is 05:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy