Unix/Linux Go Back    

Homework & Coursework Questions Students must use and complete the template provided. If you don't, your post may be deleted! Special homework rules apply here.

Calculate sum of the field

Homework & Coursework Questions

Closed Linux or Unix Question    
Thread Tools Search this Thread Display Modes
Old Unix and Linux 09-02-2013
lathanandhini lathanandhini is offline
Registered User
Join Date: Mar 2013
Last Activity: 2 September 2013, 6:54 AM EDT
Posts: 4
Thanks: 3
Thanked 0 Times in 0 Posts
Calculate sum of the field

Hi All,

I need to calculat the sum of the particular field in text file. And the datatype of the field in file is decimal(18,2). If the file is small, then I am facing any problem. But the file is huge, then the result is converted into exponential format.

I tried using various command thr this forum, but still facing the problem.

AMOUNT=`orchadmin dump -field AMOUNT $1/$2 | awk '{sum+=$1} END {printf("%.2f",sum)}'`

Thanks in advance.
Moderator's Comments:
This is the 3rd homework violation. The homework template must be filled in when posting to the Homework & Coursework forum. This thread is closed.

Last edited by Don Cragun; 09-02-2013 at 07:46 AM..
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help with calculate total sum of same data problem perl_beginner Shell Programming and Scripting 2 06-16-2011 06:14 AM
calculate sum size of files by date (arg list too long) beginningDBA Solaris 2 08-04-2010 11:45 PM
How to sum particular field in text file? suryanarayana Shell Programming and Scripting 3 02-23-2010 08:10 AM
Calculate total sum from a file TehOne Shell Programming and Scripting 11 05-28-2009 01:46 PM
How to calculate a sum of certain records? sickboy Shell Programming and Scripting 10 06-10-2005 12:43 PM

All times are GMT -4. The time now is 10:38 PM.