Sponsored Content
Top Forums Shell Programming and Scripting Convert listner.log to csv format with comma seperated Post 303010583 by skoshekay on Wednesday 3rd of January 2018 04:43:45 PM
Old 01-03-2018
Thanks for the reply, however i am still not getting the correct results

this is my sample listner.log

Code:
12-DEC-2017 15:20:57 * (CONNECT_DATA=(SID=TEST)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=000.00.000.00)(PORT=62965)) * establish * TEST * 0
12-DEC-2017 15:21:11 * (CONNECT_DATA=(CID=(PROGRAM=SQL DevelTEST)(HOST=__jdbc__)(USER=Naresh))(SID=TEST)) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.33.9.20)(PORT=50314)) * establish * TEST * 0
12-DEC-2017 15:21:39 * (CONNECT_DATA=(SID=TEST)(CID=(PROGRAM=perl@test)(HOST=test)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=000.00.000.00)(PORT=63031)) * establish * TEST * 0
12-DEC-2017 15:21:51 * (CONNECT_DATA=(SID=TEST)(CID=(PROGRAM=perl@test)(HOST=test)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=000.00.000.00)(PORT=63049)) * establish * TEST * 0
12-DEC-2017 15:22:23 * (CONNECT_DATA=(CID=(PROGRAM=SQL DevelTEST)(HOST=__jdbc__)(USER=Naresh))(SID=TEST)) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.33.9.20)(PORT=50323)) * establish * TEST * 0
12-DEC-2017 15:25:21 * (CONNECT_DATA=(SID=TEST)(CID=(PROGRAM=perl@test)(HOST=test)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=000.00.000.00)(PORT=63393)) * establish * TEST * 0
12-DEC-2017 15:25:50 * (CONNECT_DATA=(SID=TEST)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=000.00.000.00)(PORT=63440)) * establish * TEST * 0
12-DEC-2017 15:26:49 * (CONNECT_DATA=(SID=TEST)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=000.00.000.00)(PORT=63537)) * establish * TEST * 12518

which i wanted to convert this to a csv file with comma seperated.

Code:
DATE,SID,HOST,USER,ADDRESS

Thank you

---------- Post updated at 05:43 PM ---------- Previous update was at 05:31 PM ----------

this is the output i am getting

Code:
SID,HOST,PORT,USER
TEST,__jdbc__,50314,Naresh,DevelTEST)(HOST=__jdbc__)(USER=Naresh))(SID=TEST)),*,(ADDRESS=(PROTOCOL=tcp)(HOST=10.33.9.20)(PORT=50314)),*,establish,*,TEST,*,0
TEST,__jdbc__,50323,Naresh,DevelTEST)(HOST=__jdbc__)(USER=Naresh))(SID=TEST)),*,(ADDRESS=(PROTOCOL=tcp)(HOST=10.33.9.20)(PORT=50323)),*,establish,*,TEST,*,0
TEST,__jdbc__,62965,oracle,*,(ADDRESS=(PROTOCOL=tcp)(HOST=000.00.000.00)(PORT=62965)),*,establish,*,TEST,*,0
TEST,__jdbc__,63440,oracle,*,(ADDRESS=(PROTOCOL=tcp)(HOST=000.00.000.00)(PORT=63440)),*,establish,*,TEST,*,0
TEST,__jdbc__,63537,oracle,*,(ADDRESS=(PROTOCOL=tcp)(HOST=000.00.000.00)(PORT=63537)),*,establish,*,TEST,*,12518
TEST,test,63031,oracle,*,(ADDRESS=(PROTOCOL=tcp)(HOST=000.00.000.00)(PORT=63031)),*,establish,*,TEST,*,0
TEST,test,63049,oracle,*,(ADDRESS=(PROTOCOL=tcp)(HOST=000.00.000.00)(PORT=63049)),*,establish,*,TEST,*,0
TEST,test,63393,oracle,*,(ADDRESS=(PROTOCOL=tcp)(HOST=000.00.000.00)(PORT=63393)),*,establish,*,TEST,*,0


Last edited by RudiC; 01-04-2018 at 06:10 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to load comma seperated values file (*.csv) into Oracle table

Hi all I need to input values in a .csv file into my Oracle table running in Unix, I wonder what would be the command to do so... The values are recorded in an excel file and I tried using a formatted text file to do so but failed because one of the field is simply too large to fit in the... (5 Replies)
Discussion started by: handynas
5 Replies

2. UNIX for Advanced & Expert Users

How to load comma seperated values file (*.csv) into Oracle table

Hi all I need to input values in a .csv file into my Oracle table running in Unix, I wonder what would be the command to do so... The values are recorded in an excel file and I tried using a formatted text file to do so but failed because one of the field is simply too large to fit in the... (4 Replies)
Discussion started by: handynas
4 Replies

3. Shell Programming and Scripting

Handling .CSV( Comma seperated value) in awk

Hi Guys, I am trying to reading in comma seperated values in awk. I can set the delimiter to be a comma, but the tricky part is that commas that appear within quotes are not to be considered as delimiters. Could someone please help. Regards, Laud (1 Reply)
Discussion started by: Laud12345
1 Replies

4. Shell Programming and Scripting

how to convert the result of the select query to comma seperated data - urgent pls

how to convert the result of the select query to comma seperated data and put in a .csv file using korn shell. Pls help me as its very urgent. Thanks, Hema. (1 Reply)
Discussion started by: Hemamalini
1 Replies

5. UNIX for Dummies Questions & Answers

converting a tabular format data to comma seperated data in KSH

Hi, Could anyone help me in changing a tabular format output to comma seperated file pls in K-sh. Its very urgent. E.g : username empid ------------------------ sri 123 to username,empid sri,123 Thanks, Hema:confused: (2 Replies)
Discussion started by: Hemamalini
2 Replies

6. Shell Programming and Scripting

Convert comma text file to Column in html format

I am trying to generate a report with below file : File1 : EQADM,edrtere9-phys,8122caef0,gpatmon,/bin/ksh,nuten Erick EQADM,edrtere11-phys,8227caef0,gpatmon,/bin/ksh,nuten Erick EQADM,edrtere3-phys,822caef0,gpatmon,/bin/ksh,nuten Erick can you help me convert it to html and add... (9 Replies)
Discussion started by: sriram003
9 Replies

7. Shell Programming and Scripting

Removing blank lines from comma seperated and space seperated file.

Hi, I want to remove empty/blank lines from comma seperated and space seperated files Thanks all for help (11 Replies)
Discussion started by: pinnacle
11 Replies

8. Shell Programming and Scripting

how to convert this file into comma delimited format

Hi experts, I need urget help! I have the a text file with this format: Types of fruits Name of fruits 1,1 Farm_no,1 apple,1 pineapple,1 grapes,1 orange,1 banana,1 2,2--->this is the record seperator Farm_no,2 apple,1 pineapple,1 grapes,3 orange,2 banana,1 3,3--->this is the... (1 Reply)
Discussion started by: natalie23
1 Replies

9. UNIX for Advanced & Expert Users

Urgent! need help! how to convert this file into comma delimited format

Hi experts, I need urget help! I have the a text file with this format: Types of fruits Name of fruits 1,1 Farm_no,1 apple,1 pineapple,1 grapes,1 orange,1 banana,1 2,2--->this is the record seperator Farm_no,2 apple,1 pineapple,1 grapes,3 orange,2 banana,1 3,3--->this is the... (2 Replies)
Discussion started by: natalie23
2 Replies

10. Shell Programming and Scripting

Convert comma seperated file to line seperated.

Hi, I have data like this. 1,2,3,4 Output required: 1 2 3 4 I am trying to use tr function but getting error. Help is appreciated. (6 Replies)
Discussion started by: pinnacle
6 Replies
TEST(1) 						      General Commands Manual							   TEST(1)

NAME
test, [ - test for a condition SYNOPSIS
test expr [ expr ] OPTIONS
(none) EXAMPLES
test -r file # See if file is readable DESCRIPTION
Test checks to see if files exist, are readable, etc. and returns an exit status of zero if true and nonzero if false. The legal operators are -r file true if the file is readable -w file true if the file is writable -x file true if the file is executable -f file true if the file is not a directory -d file true if the file is a directory -s file true if the file exists and has a size > 0 -t fd true if file descriptor fd (default 1) is a terminal -z s true if the string s has zero length -n s true if the string s has nonzero length s1 = s2 true if the strings s1 and s2 are identical s1 != s2 true if the strings s1 and s2 are different m -eq m true if the integers m and n are numerically equal The operators -gt, -ge, -ne, -le, and -lt may be used as well. These operands may be combined with -a (Boolean and), -o (Boolean or), ! (negation). The priority of -a is higher than that of -o. Parentheses are permitted, but must be escaped to keep the shell from trying to interpret them. SEE ALSO
expr(1), sh(1). TEST(1)
All times are GMT -4. The time now is 06:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy