Sponsored Content
Top Forums UNIX for Beginners Questions & Answers UNIX shell script for matrix insertion into a file Post 303042126 by TNT47 on Monday 16th of December 2019 12:09:36 AM
Old 12-16-2019
Hello Sir,

Date is retrieved from SQL it is in this format YYYY-MM-DD HH24MI i.e 2019-12-12 0001 and is having data for 1 hour i.e 2019-12-12 0001 to 2019-12-12 0060
the whole output of the query consists of 3 columns date_time calling_app and count of requests

SQL script output is like given below
Code:
Date_time	Calling_app	Count
2019-12-12 0000	X	12
2019-12-12 0001	y	3
2019-12-12 0002	c	4
2019-12-12 0003	v	6
2019-12-12 0004	a	8
2019-12-12 0005	q	7

Want output like this, Also please note that there can be entries in between the timestamps for other applications as well
Code:
Date_time	x	y	c	v	a	q
2019-12-12 0000	12					
2019-12-12 0001		3				
2019-12-12 0002			4			
2019-12-12 0003				6		
2019-12-12 0004					8	
2019-12-12 0005						7

Also pleas let me know if any more inputs or data is required from my end.

Thanks,
TNT47

Moderator's Comments:
Mod Comment Please do wrap your samples/codes in your posts in CODE TAGS as per forum rules.

Last edited by RavinderSingh13; 12-16-2019 at 01:31 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unix file operations(shell script)

Hi, I want to compare two files. Files will look like as follows: file1: ASDFGHJU|1234567890123456 QWERTYUI|3456789098900890 file2: ZXCVBVNM|0987654321234567 POLKIJUYH|1234789060985478 output file should be: ASDFGHJU|1234567890123456 QWERTYUI|3456789098900890 Thnaks in advance (6 Replies)
Discussion started by: nivas
6 Replies

2. Shell Programming and Scripting

Is it possible to draw table/matrix using shell script?

Hi all, I need to create a matrix of variable rows and columns. Right now i have 3 rows and two columns and following values. Output something like TypeA TypeB TestCase1 Pass Fail TestCase2 Pass ... (2 Replies)
Discussion started by: jakSun8
2 Replies

3. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

4. Shell Programming and Scripting

insertion of text from sed script

Hi , This is my first thread ; facing some issues withmy sed script I need to insert the code from my log file which is between two keywords. content is like this ........ log ############################ log1 log2 231 "Ban" "tom" and the line one of the cross line friend... (2 Replies)
Discussion started by: shalini_008
2 Replies

5. Shell Programming and Scripting

Insertion in a file

Hi All, I want to insert a line just befor the lst line in a file. please can anyone advise. Cheers, Shazin (3 Replies)
Discussion started by: Shazin
3 Replies

6. Shell Programming and Scripting

Execute unix shell script to text file using the script

Hi all, I am beginner in UNIX...I want to use unix shell script to create text.file...I know how to use using by command...can anybody tell me for the script? Thanks i changed the threads title from "tex file" to "text file", because "tex" would probably be misunderstood as reference to... (4 Replies)
Discussion started by: mastercar
4 Replies

7. Shell Programming and Scripting

AWK script problem insertion of code

Hi , I am having two files like this FILE1 #################### input SI_TESTONLY_R_00; input CE0_SE_INPUT_TESTONLY; input CE0_TCLK_TESTONLY; input SI_JTGCLOCKDR_JTAG_R_00; input CE0_TCLK_JTGCLOCKDR_JTAG; input CE0_SE_INPUT_JTGCLOCKDR_JTAG; output SO_TESTONLY_R_00; output... (2 Replies)
Discussion started by: jaita
2 Replies

8. Shell Programming and Scripting

UNIX Shell script to work with .xml file

Hi Team, Could you please help me on below query: I want to retrieve XML elements from one .xml file. This .xml file has commented tags as well. so i am planning to write Unix command/script which 1.will chekc for this .xml file 2. it will ignore the commented XML lines. i.e. XML tags between... (3 Replies)
Discussion started by: waiting4u
3 Replies

9. Shell Programming and Scripting

UNIX shell script to search a string in a file

Hi folks, I am new for shell script, I hope somebody to help me to write shell script My requirement is below steps 1. I have apache access.log i.e located in /var/log/httpd/ Ex. 127.0.0.1 - - "GET... (14 Replies)
Discussion started by: Chenchireddy
14 Replies

10. UNIX for Beginners Questions & Answers

Shell script to Split matrix file with delimiter into multiple files

I have a large semicolon delimited file with thousands of columns and many thousands of line. It looks like: ID1;ID2;ID3;ID4;A_1;B_1;C_1;A_2;B_2;C_2;A_3;B_3;C_3 AA;ax;ay;az;01;02;03;04;05;06;07;08;09 BB;bx;by;bz;03;05;33;44;15;26;27;08;09 I want to split this table in to multiple files: ... (1 Reply)
Discussion started by: trymega
1 Replies
pstopdf(1)						    BSD General Commands Manual 						pstopdf(1)

NAME
pstopdf -- convert PostScript input into a PDF document. SYNOPSIS
pstopdf [inputfile] [-o outname] [-l] [-p] DESCRIPTION
pstopdf is a tool to convert PostScript input data into a PDF document. The input data may come from a file or may be read from stdin. The PDF document is always written to a file. The name of the output PDF file is derived from the name of the input file or may be explicitly named using the -o option. Flags: -o outname The name of the output file to create. If an explicit file name is not supplied, the output file will be created in the current directory and named foo.pdf for an input file named foo.ps -l Specifies that any messages generated during file conversion be written to a log file. For an output file named foo.pdf the generated log file is foo.pdf.log rather than generated to stdout. If there are no messages, the log file is not generated. -p Generates a simple progress message to stdout at the end of each page. Because conversion of complex or lengthy PostScript input can take time, it is sometimes useful to see that progress is being made. Progress messages are always written to stdout even when the -l (log file) option is specified. EXAMPLES
pstopdf inputfile.ps Creates a PDF file named inputfile.pdf from the PostScript data in the input file inputfile.ps pstopdf -o outputfilename Creates a PDF file named outputfilename from the PostScript data read from stdin. Apple Computer, Inc. May 31, 2019 Apple Computer, Inc.
All times are GMT -4. The time now is 09:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy