Sponsored Content
Top Forums Shell Programming and Scripting Help/Advise on parsing these line of text Post 302759723 by newbie_01 on Tuesday 22nd of January 2013 09:02:07 PM
Old 01-22-2013
Help/Advise on parsing these line of text

Hi,

Can anyone please advise how do I parse the following line of strings?

Code:
14-OCT-2012 06:38:59 * (CONNECT_DATA=(SID=test)(GLOBAL_NAME=test.mydb.com.ch)(CID=(PROGRAM=Z:\Ora6i\BIN\ifrun60.EXE)(HOST=8000XXX05004RV)(USER=mickey))) * (ADDRESS=(PROTOCOL=tcp)(HOST=11.90.24.239)(PORT=1552)) * establish * test * 0
14-OCT-2012 06:39:15 * (CONNECT_DATA=(SID=test)(GLOBAL_NAME=test.mydb.com.ch)(CID=(PROGRAM=Z:\Ora6i\BIN\RWRBE60.exe)(HOST=8000XXX05004RV)(USER=mickey))) * (ADDRESS=(PROTOCOL=tcp)(HOST=11.90.24.239)(PORT=1574)) * establish * test * 0
14-OCT-2012 06:40:48 * (CONNECT_DATA=(SID=test)(GLOBAL_NAME=test.mydb.com.ch)(CID=(PROGRAM=Z:\Ora6i\BIN\ifrun60.EXE)(HOST=8200XXX138060Z)(USER=mouse))) * (ADDRESS=(PROTOCOL=tcp)(HOST=11.217.35.94)(PORT=2525)) * establish * test * 0
14-OCT-2012 07:01:04 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=server911)(USER=oracle))(COMMAND=status)(ARGUMENTS=64)(SERVICE=test)(VERSION=135296000)) *
status * 0

- I am wanting parse or de-construct it so that I can get the HOST, PROGRAM and USER

- awk's -F and cut only accept single delimiter so am lost on how to parse these strings.

- Feedback/advise much appreciated. Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Parsing text from one line with shell scripts

Hi Gurus! I wonder if anyone can help me, I'm sure you guys can. I have a text file which contains a lot of data on the one line as follows: $ What I need to do is pull all of those id values out (eg 2549425) and write them to a list in a text file. Any help would be greatly... (3 Replies)
Discussion started by: th3g0bl1n
3 Replies

2. Shell Programming and Scripting

Parsing text from file

Any ideas? 1)loop through text file 2)extract everything between SOL and EOL 3)output files, for example: 123.txt and 124.txt for the file below So far I have: sed -n "/SOL/,/EOL/{p;/EOL/q;}" file Here is an example of my text file. SOL-123.go something goes here something goes... (0 Replies)
Discussion started by: ndnkyd
0 Replies

3. Shell Programming and Scripting

Perl question, parsing line by line

Hello, Im very new to PERL and as a project to work on developing my skills at PERL Im trying to parse poker hands. Ive tried many methods however I cant get the last step. $yourfile= 'FILENAME';#poker hands to parse open (FILE, "$yourfile") or die $!; @lines = <FILE>; for (@lines) ... (1 Reply)
Discussion started by: Ek0
1 Replies

4. Shell Programming and Scripting

Parsing text

Hello all, I have some text formatted as follows Name: John doe Company: Address 1: 7 times the headache Address 2: City: my city State/Province: confusion Zip/Postalcode: 12345 and I'm trying to figure out how I could extract the data after the colon so that the result would be ... (6 Replies)
Discussion started by: mcgrailm
6 Replies

5. Programming

Parsing a Text file using C++

I was trying to parse the text file, which will looks like this ###XYZABC#### ############ int = 4 char = 1 float = 1 . . ############ like this my text file will contains lots of entries and I need to store these entries in the map eg. map.first = int and map.second = 4 same way I... (5 Replies)
Discussion started by: agupta2
5 Replies

6. UNIX for Dummies Questions & Answers

Parsing file, reading each line to variable, evaluating date/time stamp of each line

So, the beginning of my script will cat & grep a file with the output directed to a new file. The data I have in this file needs to be parsed, read and evaluated. Basically, I need to identify the latest date/time stamp and then calculate whether or not it is within 15 minutes of the current... (1 Reply)
Discussion started by: hynesward
1 Replies

7. Shell Programming and Scripting

Parsing and filtering multiline text into comma separated line

I have a log file that contains several reports with following format. <Start of delimiter> Report1 header Report1 header continue Report1 header continue Record1 header Record1 header continue Record1 header continue field1 field2 field3 field4 ------... (1 Reply)
Discussion started by: yoda9691
1 Replies

8. Shell Programming and Scripting

Parsing text file

Hi Friends, I am back for the second round today - :D My input text file is this way Home friends friendship meter Tools Mirrors Downloads My Data About Us Help My own results BLAT Search Results ACTIONS QUERY SCORE START END QSIZE IDENTITY CHRO STRAND ... (7 Replies)
Discussion started by: jacobs.smith
7 Replies

9. Shell Programming and Scripting

Parsing blocked text

I do have a flat text file that are divided into blocks. Each block is demimited by '='. I would like to parse certain numbers and letters. This is the format of the file I have. It has thousands of such blocks >A B 1, 100 TTTT 100 95 >C D 1, 95 GHJKL = >A B 1, 72 GHUJKLO 72 84 >C D... (3 Replies)
Discussion started by: Kanja
3 Replies

10. Shell Programming and Scripting

Text parsing

Hi All! Is it possible to convert text file: to: ? (6 Replies)
Discussion started by: y77
6 Replies
CURLOPT_CONNECT_TO(3)					     curl_easy_setopt options					     CURLOPT_CONNECT_TO(3)

NAME
CURLOPT_CONNECT_TO - Connect to a specific host and port instead of the URL's host and port SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CONNECT_TO, struct curl_slist *connect_to); DESCRIPTION
Pass a pointer to a linked list of strings with "connect to" information to use for establishing network connections with this handle. The linked list should be a fully valid list of struct curl_slist structs properly filled in. Use curl_slist_append(3) to create the list and curl_slist_free_all(3) to clean up an entire list. Each single string should be written using the format HOST:PORT:CONNECT-TO-HOST:CONNECT-TO-PORT where HOST is the host of the request, PORT is the port of the request, CONNECT-TO-HOST is the host name to connect to, and CONNECT-TO-PORT is the port to connect to. The first string that matches the request's host and port is used. Dotted numerical IP addresses are supported for HOST and CONNECT-TO-HOST. A numerical IPv6 address must be written within [brackets]. Any of the four values may be empty. When the HOST or PORT is empty, the host or port will always match (the request's host or port is ignored). When CONNECT-TO-HOST or CONNECT-TO-PORT is empty, the "connect to" feature will be disabled for the host or port, and the request's host or port will be used to establish the network connection. This option is suitable to direct the request at a specific server, e.g. at a specific cluster node in a cluster of servers. The "connect to" host and port are only used to establish the network connection. They do NOT affect the host and port that are used for TLS/SSL (e.g. SNI, certificate verification) or for the application protocols. In contrast to CURLOPT_RESOLVE(3), the option CURLOPT_CONNECT_TO(3) does not pre-populate the DNS cache and therefore it does not affect future transfers of other easy handles that have been added to the same multi handle. The "connect to" host and port are ignored if they are equal to the host and the port in the request URL, because connecting to the host and the port in the request URL is the default behavior. If an HTTP proxy is used for a request having a special "connect to" host or port, and the "connect to" host or port differs from the requests's host and port, the HTTP proxy is automatically switched to tunnel mode for this specific request. This is necessary because it is not possible to connect to a specific host or port in normal (non-tunnel) mode. When this option is passed to curl_easy_setopt(3), libcurl will not copy the entire list so you must keep it around until you no longer use this handle for a transfer before you call curl_slist_free_all(3) on the list. DEFAULT
NULL PROTOCOLS
All EXAMPLE
CURL *curl; struct curl_slist *connect_to = NULL; connect_to = curl_slist_append(NULL, "example.com::server1.example.com:"); curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CONNECT_TO, connect_to); curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); curl_easy_perform(curl); /* always cleanup */ curl_easy_cleanup(curl); } curl_slist_free_all(connect_to); AVAILABILITY
Added in 7.49.0 RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. SEE ALSO
CURLOPT_URL(3), CURLOPT_RESOLVE(3), CURLOPT_FOLLOWLOCATION(3), CURLOPT_HTTPPROXYTUNNEL(3), libcurl 7.54.0 May 20, 2016 CURLOPT_CONNECT_TO(3)
All times are GMT -4. The time now is 08:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy