Sponsored Content
Full Discussion: Output in table
Top Forums Shell Programming and Scripting Output in table Post 302929578 by RudiC on Tuesday 23rd of December 2014 05:53:29 AM
Old 12-23-2014
This might do what you want:
Code:
awk -F: 'NR==1                  {print HD
                                 HDCnt=split(HD, HDArr)
                                 HDCM=FS HD FS
                                 NXTREC="^=-=-=-"
                                }


         $1 ~ NXTREC && PR      {printf "%s", RES[HDArr[1]]
                                 for (i=2; i<=HDCnt; i++) printf "%s%s", FS, RES[HDArr[i]]
                                 printf "\n"
                                 delete RES
                                }
         $1 ~ NXTREC            {PR=1}

         HDCM ~ FS $1 FS        {sub (/\(.*$/, "", $2); RES[$1]=$2}


         END                    {printf "%s", RES[HDArr[1]]
                                 for (i=1; i<=HDCnt; i++) printf "%s%s", FS, RES[HDArr[i]]
                                 printf "\n"
                                }
        ' HD="PoolManager name:Total number of connections" file
PoolManager name:Total number of connections
jdbc/AntalisUK.XA: 1 
jdbc/AntalisDE.XA: 0 
::

I've used ":" as the input and output record saparator here; adapt it if need be. If you can make sure there's always a record separator "=-=-=-..." in the end, you can drop the END section.
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

displaying output in a table.

Hello, I've just finished my first script (about displaying open ports on the computer and who opened them) and everything is fine with it but I want to style it a little bit just for the sake of learning how to do this. What I want to do is make the display like the one of ps, for example,... (6 Replies)
Discussion started by: sanchopansa
6 Replies

2. Shell Programming and Scripting

to create an output file as a table

Hi, I have four input files and would like to create an output file as a table. Please check the example below. File 1. 111111 222222 333333 444444 File 2. 555555 666666 777777 888888 File 3. aaaaa bbbbb ccccc ddddd (2 Replies)
Discussion started by: marcelus
2 Replies

3. Shell Programming and Scripting

Script for a syntax output for a table.

Hello Unix Gurus, I need a few instuructions how to approach the following scenarios.For a given TABLENAME a script should display the following structure on the screen.The structure should be as below.for a given perticular table. SELECT *FROM TAB1 a JOIN TAB1 b ON ... (0 Replies)
Discussion started by: kanakaraju
0 Replies

4. Shell Programming and Scripting

convert the output in table format

Hi All, I have a output like below values val1=test.com val2=10.26.208.11 val3=en1 val4=test-priv1.com val5=192.168.3.4 val6=en2 val7=test-priv2.com val8=192.168.4.4 val9=en3 val10=test-vip.com val11=10.26.208.9 val12=$val3 I want to convet this output values into below... (1 Reply)
Discussion started by: kamauv234
1 Replies

5. Shell Programming and Scripting

Excel table like output with printf

Hi All; I try to create a excel like table with headers and some fields containing values, other long and complex mathematic formulas. I have some header like : Name Formula Value True/False Under name column, they are some formula names, formula column some long mathematic formulas... (9 Replies)
Discussion started by: reseki
9 Replies

6. Shell Programming and Scripting

Output in table format

I have one script which generate file called report.txt having following output parameter_name status comment banking ok NA finance 30% hike NA Loan_department ok 20% HR_Group defaulters Ajay I wanted to convert this file into tabular form. You can see each line contain 3 words and... (7 Replies)
Discussion started by: Nakul_sh
7 Replies

7. Shell Programming and Scripting

I want query output to send on mail using table tag and output should be in table

#! /bin/ksh #] && . ./.profile 2>/dev/null if test -f '.profile'; then . ./.profile; fi; #. .profile LOG_DIR=/app/rpx/jobs/scripts/just/logs sendEmail() { pzCType="$1"; pzTitle="$2"; pzMsg="$3"; pzFrom="$4"; pzTo="$5"; pzFiles="$6"; pzReplyTo="$7" ( ... (21 Replies)
Discussion started by: ankit.mca.aaidu
21 Replies

8. Solaris

SQL QUERY to Table Output

Hi I am trying to run sql query from solaris in csh script and send the output to email. Below is my sql query select p.spid,se.program seprogram, se.machine, se.username, sq.sql_text,sq.retrows from v$process p inner join v$session se on p.addr = se.paddr inner join ( select... (2 Replies)
Discussion started by: tharmendran
2 Replies

9. Shell Programming and Scripting

Need the output in the mentioned Table format

Hi Friends, I have the script output like below: Script Output: ----------------------------------------------------------------------- Details of the Client: ----------------------- name: server1; save set: All; ... (3 Replies)
Discussion started by: akmani
3 Replies

10. Shell Programming and Scripting

Shell output format like table

Hi, OS: Redhat 7.5 shell: Bash Wrote below script to login into oracle via shell script and trying to reset locked account..It works as expected. But I need specific output << EOF should go to target terminal not all out put running below script from ansible command line.. #!/bin/bash... (1 Reply)
Discussion started by: onenessboy
1 Replies
cla_lin_berr.f(3)						      LAPACK							 cla_lin_berr.f(3)

NAME
cla_lin_berr.f - SYNOPSIS
Functions/Subroutines subroutine cla_lin_berr (N, NZ, NRHS, RES, AYB, BERR) CLA_LIN_BERR Function/Subroutine Documentation subroutine cla_lin_berr (integerN, integerNZ, integerNRHS, complex, dimension( n, nrhs )RES, real, dimension( n, nrhs )AYB, real, dimension( nrhs )BERR) CLA_LIN_BERR Purpose: CLA_LIN_BERR computes componentwise relative backward error from the formula max(i) ( abs(R(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) where abs(Z) is the componentwise absolute value of the matrix or vector Z. Parameters: N N is INTEGER The number of linear equations, i.e., the order of the matrix A. N >= 0. NZ NZ is INTEGER We add (NZ+1)*SLAMCH( 'Safe minimum' ) to R(i) in the numerator to guard against spuriously zero residuals. Default value is N. NRHS NRHS is INTEGER The number of right hand sides, i.e., the number of columns of the matrices AYB, RES, and BERR. NRHS >= 0. RES RES is DOUBLE PRECISION array, dimension (N,NRHS) The residual matrix, i.e., the matrix R in the relative backward error formula above. AYB AYB is DOUBLE PRECISION array, dimension (N, NRHS) The denominator in the relative backward error formula above, i.e., the matrix abs(op(A_s))*abs(Y) + abs(B_s). The matrices A, Y, and B are from iterative refinement (see cla_gerfsx_extended.f). BERR BERR is COMPLEX array, dimension (NRHS) The componentwise relative backward error from the formula above. Author: Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd. Date: November 2011 Definition at line 102 of file cla_lin_berr.f. Author Generated automatically by Doxygen for LAPACK from the source code. Version 3.4.1 Sun May 26 2013 cla_lin_berr.f(3)
All times are GMT -4. The time now is 08:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy