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
taskpolicy(8)						    BSD System Manager's Manual 					     taskpolicy(8)

NAME
taskpolicy -- execute a program with an altered I/O or scheduling policy SYNOPSIS
taskpolicy [-d policy] [-b] program [arg1 [...]] DESCRIPTION
The taskpolicy program uses the setiopolicy_np(3) and setpriority(2) APIs to execute a program with altered I/O or scheduling policies. All children of the specified program also inherit these policies. taskpolicy accepts the following flags and arguments: -d policy Run the program after calling setiopolicy_np(3) with an iotype of IOPOL_TYPE_DISK, a scope of IOPOL_SCOPE_PROCESS, and the specified policy. The argument can either be an integer, or a symbolic string like "default" or "throttle", which is inter- preted case-insensitively. -g policy Run the program after calling setiopolicy_np(3) with an iotype of IOPOL_TYPE_DISK, a scope of IOPOL_SCOPE_DARWIN_BG, and the specified policy. The argument is interpreted in the same manor as -d. -b Run the program after calling setpriority(2) with a priority of PRIO_DARWIN_BG. SEE ALSO
setpriority(2), setiopolicy_np(3) Darwin June 2, 2019 Darwin
All times are GMT -4. The time now is 06:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy