Sponsored Content
Top Forums Shell Programming and Scripting How To Sum Values Inside One Line In UNIX.? Post 302735687 by Ala Alzyadat on Monday 26th of November 2012 03:09:05 AM
Old 11-26-2012
thx Smilie
It works nicely
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to sum values from 2 different files?

Hi I am trying to add count values from two different files into one file. Could any body please suggest me best command to do this? My problem was as follows: a.txt b.txt c.txt 10 20 30(needed) i tried cat a.txt b.txt > c.txt (its not adding the values) Thanks in advance.. Praveen (8 Replies)
Discussion started by: npk2210
8 Replies

2. Shell Programming and Scripting

How to sum values from top

Hi. Im looking for way to sum numbers from top. For example i have such command top -b -n | grep Cpu | cut -c 35 - 39 which give me output 97.0 . Ho can i do with that value any arithmetic actions (for example 97.0 +1)? Using c = $((top -b -n | grep Cpu | cut -c 35 - 39)) gives me... (8 Replies)
Discussion started by: qdf
8 Replies

3. Shell Programming and Scripting

How to sum up two decimal values?

I am running the following script : cat ind_sls_extr_UX.out_sorted | while read each_rec do count=`echo "${each_rec}" | cut -c1-2` if then final_amount=0 amount=`echo "${each_rec}" | cut -c280-287` echo "${amount}" final_amount=`expr ${amount} + ${amount}` ... (7 Replies)
Discussion started by: mady135
7 Replies

4. Shell Programming and Scripting

Taking sum up all values inside the file

Hi, Taking sum up all values inside the file by using the below command: paste -sd+ filenmae | bc Getting some error like "0705-001: building space exceeded on line1 stdin" The original data looks like SPACE SPACE SPACE 0.123 JOBNAME1 SPACE SPACE 20.325 JOBNAME2 SPACE SPACE... (2 Replies)
Discussion started by: NareshN
2 Replies

5. UNIX for Dummies Questions & Answers

sum values based on ID

Hi, I would like to be able to sum up the counts of a column by the ID of another column. Example (although the actual file I have has thousands of IDs): Input file: A1BG-AS1:001 3 A1BG-AS1:002 0 A1BG-AS1:003 2 A1CF:001 1038 A1CF:002 105 A1CF:003 115 A1CF:004 137 Desired output... (3 Replies)
Discussion started by: fadista
3 Replies

6. Shell Programming and Scripting

How to fetch values from a line in a file to variables in UNIX?

Hi, I need to assign values from a lines in a file into variables in unix, i am using Korn shell. I tried the below script from posts but i am unable to fetch every value in a variable. #! /usr/bin/ksh #for file in test.txt; do IFS=$'\|' I=1 while read -a val do echo... (15 Replies)
Discussion started by: karthikram
15 Replies

7. UNIX for Dummies Questions & Answers

Unique values in a row sum the next column in UNIX

Hi would like to ask you guys any advise regarding my problem I have this kind of data file.txt 111111111,20 111111111,50 222222222,70 333333333,40 444444444,10 444444444,20 I need to get this file1.txt 111111111,70 222222222,70 333333333,40 444444444,30 using this code I can... (6 Replies)
Discussion started by: reks
6 Replies

8. UNIX for Dummies Questions & Answers

Sum up values followed by pattern

I have a file with data merged from multiple files. File contains header, data and trailer of multiple files. The trailer starts with 99 and delimiter is ~. Trailer 99~120 99~30 As it is a merged file we i have multiple lines followed by 99~. Need help to find sum of values which are there... (4 Replies)
Discussion started by: santoshdrkr
4 Replies

9. Shell Programming and Scripting

How to sum the value with negative values?

Hi Gurus, I have requirement need to sum the value, the logic is if the value is negative then time -1, I tried below two ways. one is failed, another one doesn't work. awk -F"," '{if($8< 0 $8*-1 else $8) sum+=$8}{print sum, $8} END{printf("%.2f\n",sum)}' awk -F","... (4 Replies)
Discussion started by: ken6503
4 Replies

10. Shell Programming and Scripting

How to sum values on specific line number?

I have a file that looks like this: HP ColorPlotter Z-6100 ACMARTIN IP 192.168.x.x "VIRTUAL HP ( C9468A ) PART 1 of 2 (REAL CARTRIDGE 1)" "VIRTUAL HP ( C9468A ) PART 2 of 2 (REAL CARTRIDGE 1)" 181 181 "VIRTUAL HP ( C9471A ) PART 1 of 2 (REAL CARTRIDGE 2)" "VIRTUAL HP ( C9471A ) PART 2... (4 Replies)
Discussion started by: SysAdminRialto
4 Replies
DD-LIST(1)						      General Commands Manual							DD-LIST(1)

NAME
dd-list - nicely list .deb packages and their maintainers SYNOPSIS
dd-list [-hiusV] [--help] [--stdin] [--sources Sources_file] [--dctrl] [--version] [--uploaders] [package ...] DESCRIPTION
dd-list produces nicely formatted lists of Debian (.deb) packages and their maintainers. Input is a list of source or binary package names on the command line (or the standard input if --stdin is given). Output is a list of the following format, where package names are source packages by default: J. Random Developer <jrandom@debian.org> j-random-package j-random-other Diana Hacker <diana@example.org> fun-package more-fun-package This is useful when you want, for example, to produce a list of packages that need to attention from their maintainers, e.g., to be rebuilt when a library version transition happens. OPTIONS
-h, --help Print brief help message. -i, --stdin Read package names from the standard input, instead of taking them from the command line. Package names are whitespace delimited. -d, --dctrl Read package list from standard input in the format of a Debian package control file. This includes the status file, or output of apt-cache. This is the fastest way to use dd-list, as it uses the maintainer information from the input instead of looking up the maintainer of each listed package. If no Source: line is given, the Package: name is used for output, which might be a binary package name. -s, --sources Sources_file Read package information from the specified Sources_files. This can be given multiple times. If no Sources_files are specified, any files matching /var/lib/apt/lists/*_source_Sources will be used. -u, --uploaders Also list developers who are named as uploaders of packages, not only the maintainers; this is the default behaviour, use --nou- ploaders to prevent it. Uploaders are indicated with "(U)" appended to the package name. -nou, --nouploaders Only list package Maintainers, do not list Uploaders. -b, --print-binary Use binary package names in the output instead of source package names (has no effect with --dctrl if the Package: line contains source package names). -V, --version Print the version. AUTHOR
Lars Wirzenius <liw@iki.fi> Joey Hess <joeyh@debian.org> Debian 2011-10-27 DD-LIST(1)
All times are GMT -4. The time now is 05:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy