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
CSV2REC(1)							   User Commands							CSV2REC(1)

NAME
csv2rec - csv to rec converter SYNOPSIS
csv2rec [OPTIONS]... [CSV_FILE] DESCRIPTION
Convert csv data into rec data. -t, --type=TYPE type name for the converted records; if this parameter is ommited then no type is used. -s, --strict be strict parsing the csv file. -e, --omit-empty omit empty fields. --help print a help message and exit. --version show version and exit. AUTHOR
Written by Jose E. Marchesi. REPORTING BUGS
Report bugs to: bug-recutils@gnu.org GNU recutils home page: <http://www.gnu.org/software/recutils/> General help using GNU software: <http://www.gnu.org/gethelp/> COPYRIGHT
Copyright (C) 2010, 2011, 2012 Jose E. Marchesi. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
The full documentation for csv2rec is maintained as a Texinfo manual. If the info and csv2rec programs are properly installed at your site, the command info csv2rec should give you access to the complete manual. csv2rec 1.4.93 January 2012 CSV2REC(1)
All times are GMT -4. The time now is 01:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy