Sponsored Content
Operating Systems HP-UX Shell /awk script for Percentage Post 303019132 by kartikirans on Saturday 23rd of June 2018 08:59:09 PM
Old 06-23-2018
Thanks Singh, command looks good for me. If there are strings in between , can we ignore this and add as NA


Code:
A|B
100|50 
200|200
DDD|DDD

Expected-

Code:
A|B|C
100|50|50%
200|200|100%
DDD|DDD|NA


Last edited by Don Cragun; 06-23-2018 at 11:57 PM.. Reason: Add CODE tags, again.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk percentage

how would you calculate percentage by per line? Given a column of 16 lines, grab each line and divide it by the sum of the entire column and multiply by 100? thanks ... (8 Replies)
Discussion started by: rockiefx
8 Replies

2. Shell Programming and Scripting

Need an AWK script to calculate the percentage

Hi I need a awk script to calculate percentage. I have to pass the pararmeters in to the awk script and calculate the percentage. Sum = 50 passed = 43 failed = 7 I need to pass these value in to the awk script and calculate the percentage. Please advice me. (8 Replies)
Discussion started by: bobprabhu
8 Replies

3. Shell Programming and Scripting

awk script to count percentage from log file

Hi, I have a log like this : actually i want to get the log like this : where % can get from : 100 * pmTotNoRrcConnectReqSucc / pmTotNoRrcConnectReq Thanks in advance.. :) (8 Replies)
Discussion started by: justbow
8 Replies

4. Shell Programming and Scripting

Script shell, how to calculate percentage?

hello, please can you help me. jj and kk are two numbers which are the result of an sql program. I would like to calculate the ratio jj/kk*100. I have done this: ratio=$((jj/kk * 100)) or ratio=`expr $jj \/ expr $kk) but the result is 0 What can i do? Thanks for help. (3 Replies)
Discussion started by: likeaix
3 Replies

5. Programming

Shell script to find Percentage?

Hi all, I havea log of data.log bear,10000,white bear,5000,black chicken,2000,white chicken,4000,yellow chicken,3000,black lion,6000,yellow lion,1000,white How can we have shell script to get the percentage of each animals? Thanks. (8 Replies)
Discussion started by: sabercats
8 Replies

6. Shell Programming and Scripting

Need an awk script to calculate the percentage of value field and replace

Need an awk script to calculate the percentage of value field and replace I have a input file called file.txt with the following content: john|622.5674603562933|8|br:1;cn:3;fr:1;jp:1;us:2 andy|0.0|12|**:3;br:1;ca:2;de:2;dz:1;fr:2;nl:1 in fourth filed of input file, calulate percentage of each... (1 Reply)
Discussion started by: veeruasu
1 Replies

7. UNIX for Dummies Questions & Answers

Need an awk script to calculate the percentage of value field and replace

I have a input file called file.txt with the following content: john|622.5674603562933|8|br:1;cn:3;fr:1;jp:1;us:2 andy|0.0|12|**:3;br:1;ca:2;de:2;dz:1;fr:2;nl:1 in fourth filed of input file, calulate percentage of each sub filed seperated by ; semicolon and replace value with percentage . i... (11 Replies)
Discussion started by: veeruasu
11 Replies

8. Shell Programming and Scripting

find percentage - awk

Please help me with this ... Input file /vol/test1 10G /vol/test2 1G /vol/test3 200G /vol/test4 3G Output File /vol/test1 10G - - 9G - /vol/test2 1024M - - 921M - /vol/test3 200G - - 180G - /vol/test4 3072M - - 2764M - Basically if Column 2 ( which is... (6 Replies)
Discussion started by: greycells
6 Replies

9. UNIX for Dummies Questions & Answers

Percentage / Multiplication in Shell Script

Hello, I am trying to compute the percentage in a script as shown below: PerCover=`echo "scale=2 ; 100 \* ($InputCover/$Total)" | bc` However the PerCover value is blank/null. What do I need to do differently? Thanks for your input! ~Guss (1 Reply)
Discussion started by: Gussifinknottle
1 Replies

10. UNIX for Beginners Questions & Answers

Working out percentage in shell script

Hi All, I currently have a shell script which is pulling multiple counters from various sources. Due to the counters being cumulative counters I've got some code to work out the delta from the last reading and current which is working fine. The problem i have now is being able to work out the... (8 Replies)
Discussion started by: mutley2202
8 Replies
ddd(1)								     GNU Tools								    ddd(1)

NAME
ddd, xddd - The Data Display Debugger SYNOPSIS
ddd [--help] [--gdb] [--dbx] [--ladebug] [--wdb] [--xdb] [--jdb] [--pydb] [--perl] [--debugger name] [--[r]host [username@]hostname]] [--trace] [--version] [--configuration] [options...] [prog[core|procID]] but usually just ddd program DESCRIPTION
DDD is a graphical front-end for GDB and other command-line debuggers. Using DDD, you can see what is going on "inside" another program while it executes--or what another program was doing at the moment it crashed. DDD can do four main kinds of things (plus other things in support of these) to help you catch bugs in the act: o Start your program, specifying anything that might affect its behavior. o Make your program stop on specified conditions. o Examine what has happened, when your program has stopped. o Change things in your program, so you can experiment with correcting the effects of one bug and go on to learn about another. "Classical" UNIX debuggers such as the GNU debugger (GDB) provide a command-line interface and a multitude of commands for these and other debugging purposes. DDD is a comfortable graphical user interface around an inferior GDB, DBX, Ladebug, XDB, JDB, Python debugger, or Perl debugger. DDD is invoked with the shell command ddd. You can open a program to be debugged using `File->Open Program' (the `Open Program' item in the `File' menu. You can get online help at any time using the `Help' menu; for the first steps, try `Help->What Now?'. Quit DDD using `File->Exit'. More information on DDD is contained in the DDD Manual. You can read the text-only version in DDD (via `Help->DDD Reference') or in Emacs (as Info file). Full-fledged HTML, PostScript, and PDF versions are available online via the DDD WWW page, http://www.gnu.org/software/ddd/ OPTIONS
These are the most important options used when starting DDD. All options may be abbreviated, as long as they are unambiguous; single dashes may also be used. DDD also understands the usual X options such as `-display' or `-geometry'; see X(1) for details. All arguments and options not handled by DDD are passed to the inferior debugger. To pass an option to the inferior debugger that con- flicts with an X option, or with a DDD option listed here, use the `--debugger' option, below. --configuration Show the DDD configuration settings and exit. --dbx Run the DBX debugger as inferior debugger. --debugger name Invoke the inferior debugger name. This is useful if you have several debugger versions around, or if the inferior debugger cannot be invoked as `gdb', `dbx', `xdb', `jdb', `pydb', or `perl' respectively. This option can also be used to pass options to the inferior debugger that would otherwise conflict with DDD options. For instance, to pass the option `-d directory' to XDB, use: ddd --debugger "xdb -d directory" If you use the `--debugger' option, be sure that the type of inferior debugger is specified as well. That is, use one of the options `--gdb', `--dbx', `--xdb', `--jdb' `--pydb', or `--perl' (unless the default setting works fine). --gdb Run the GDB debugger as inferior debugger. --help Give a list of frequently used options. Show options of the inferior debugger as well. --host [username@]hostname Invoke the inferior debugger directly on the remote host hostname. If username is given and the `--login' option is not used, use username as remote user name. --jdb Run JDB as inferior debugger. --ladebug Run Ladebug as inferior debugger. --perl Run Perl as inferior debugger. --pydb Run PYDB as inferior debugger. --rhost [username@]hostname Run the inferior debugger interactively on the remote host hostname. If username is given and the `--login' option is not used, use username as remote user name. --trace Show the interaction between DDD and the inferior debugger on standard error. This is useful for debugging DDD. If `--trace' is not specified, this information is written into `$HOME/.ddd/log', such that you can also do a post-mortem debugging. --version Show the DDD version and exit. --wdb Run the WDB debugger as inferior debugger. --xdb Run XDB as inferior debugger. A full list of options, including important options of the inferior debugger, can be found in the DDD manual. SEE ALSO
X(1), gdb(1), dbx(1), wdb(1), xdb(1), perldebug(1) `ddd' entry in info. `gdb' entry in info. Debugging with DDD: User's Guide and Reference Manual, by Andreas Zeller. Using GDB: A Guide to the GNU Source-Level Debugger, by Richard M. Stallman and Roland H. Pesch. Java Language Debugging, at http://java.sun.com/ (and its mirrors) in /products/jdk/1.1/debugging/ The Python Language, at http://www.python.org/ and its mirrors. DDD--A Free Graphical Front-End for UNIX Debuggers, by Andreas Zeller and Dorothea Luetkehaus, Computer Science Report 95-07, Technische Universitaet Braunschweig, 1995. DDD - ein Debugger mit graphischer Datendarstellung, by Dorothea Luetkehaus, Diploma Thesis, Technische Universitaet Braunschweig, 1994. The DDD FTP site, ftp://ftp.gnu.org/ The DDD WWW page, http://www.gnu.org/software/ddd/ The DDD Mailing List, ddd@gnu.org For more information on this list, send a mail to ddd-request@gnu.org . COPYRIGHT
This manual page is Copyright (C) 2001 Universitaet Passau, Germany. Permission is granted to make and distribute verbatim copies of this manual page provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual page under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual page into another language, under the above conditions for modi- fied versions, except that this permission notice may be included in translations approved by the Free Software Foundation instead of in the original English. DDD 3.3.1 2001-01-15 ddd(1)
All times are GMT -4. The time now is 05:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy