Sponsored Content
Top Forums Shell Programming and Scripting shell, read table and write the value for each factor to output Post 302719819 by pamu on Tuesday 23rd of October 2012 08:08:03 AM
Old 10-23-2012
Code:
awk -F "[ ;]" '{!X[$1]++;for(i=2;i<=NF;i++){split($i,b,"=");a[$1,b[1]]=b[2];!Y[b[1]]++;}}END{
for(i in X){s=s?s" "i:"* "i}
print s;
for(j in Y){printf j" "
for(i in X){
printf a[i,j]?a[i,j]" ":"NA "
}print ""}}' file


Last edited by pamu; 10-23-2012 at 09:16 AM..
 

10 More Discussions You Might Find Interesting

1. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

2. Shell Programming and Scripting

How to Add Table with Header for Shell Output

I have a Script that generates 3 columns of the result. The line script is /usr/xpg4/bin/awk -F' ' '{print $1 /t $2}' File_Name | awk -F'>' '{print $2}' | cut -d'<' -f1 | sort -rn | uniq -c The output of the Command is : Code.500 4 Input Error Code.404 ... (4 Replies)
Discussion started by: raghunsi
4 Replies

3. Shell Programming and Scripting

Read parameter file in a shell script to unload a DB2 Table???

Hi , I Have following requirement: DB2 Sql query to pass from a parameter file for example, I would create a parameter file with (SELECT column 1, column 2 FROM Table name) then job would read it and create a file with the contents named table.txt How to write/modify below ksh script to... (10 Replies)
Discussion started by: developer.dwh9
10 Replies

4. Homework & Coursework Questions

Write a shell script for SQL loader to load data into a staging table

Hi, I'm new to Linux. I'm working on a database, and need to load data in a database table (which I already created) using shell script. The table has two columns - Acct_number (not nullable) and date (timestamp). I'm not able to write a shell script for that. Can any one help me? ... (3 Replies)
Discussion started by: saisudeep
3 Replies

5. Shell Programming and Scripting

awk - read from a file and write conditional output

I have a file, which has '|' as separator; I need to read each line from that file and produce output to another file. While reading, I have certain condition on few specific columns (like column3 ='good'); only those lines will be processed. (3 Replies)
Discussion started by: mady135
3 Replies

6. 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

7. UNIX for Beginners Questions & Answers

How do I use grep to grab prime number output from my factor program?

I have a factor program that runs and outputs to stdout all the prime numbers that are specified in the given paramters, in this case 30000000-31000000. Command: factor/factor 30000000-31000000 Sample output: 30999979 = 30999979 30999980 = 2^2 5 11 140909 30999981 = 3 10333327... (6 Replies)
Discussion started by: steezuschrist96
6 Replies

8. Shell Programming and Scripting

Read input write multply output with creteria

Hi All Please Help Read input write multply output with creteria Exemple i have file abc 111 444 abc 111 444 def 111 444 def111 444 bbb 111 444 bbb 111 444 i would need write 3 files pos 1-3 is the Criteria output would be file1 contains abc file2 def file3 bbb ... (3 Replies)
Discussion started by: tonyk334
3 Replies

9. 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

10. UNIX for Beginners Questions & Answers

Shell Script to read hive table and send email

HI Team, I am working on reading hive table and send email in email body using shell script, can you please help on fixing the errors: I have 6 columns in my hive table and trying to send the email in the mail body. below script: #!/bin/bash hive -e 'SELECT count(*) from db.table' >... (4 Replies)
Discussion started by: Mi4304
4 Replies
PSFXTABLE(1)						      General Commands Manual						      PSFXTABLE(1)

NAME
psfxtable - handle Unicode character tables for console fonts SYNOPSIS
psfxtable [-i infont] [-o outfont] [-it intable] [-ot outtable] [-nt] DESCRIPTION
psfxtable handles the embedded Unicode character table for .psf format console fonts. It reads a font and possibly a table and writes a font and/or a table. psfaddtable(1), psfgettable(1) and psfstriptable(1) are links to it. Each of the filenames infont, outfont, intable, and outtable may be replaced by a single dash (-), in which case standard input or standard output is used. If no -i option is given, the font is read from standard input. If no -it or -o or -ot option is given, no input table is read or no output font or output table is written. By default the output font (if any) will have a Unicode table when either the input font has one, or an explicit table (which overrides an input font table) has been provided. The option -nt causes output of a font without table. When outfont is requested it will get a psf1 header when infont has a psf1 header and intable does not have sequences and a psf2 header otherwise. SEE ALSO
setfont(8), psfaddtable(1), psfgettable(1), psfstriptable(1) 9 Dec 1999 PSFXTABLE(1)
All times are GMT -4. The time now is 06:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy