Sponsored Content
Top Forums Shell Programming and Scripting Cutting all xml tags out of a line Post 303013493 by RudiC on Thursday 22nd of February 2018 06:27:48 AM
Old 02-22-2018
Try
Code:
awk -v vkey="$key" -v tagIn="$tagIn" -vtagOut="$tagOut" '
$0 ~ vkey       {print "Found:     " vkey "\n"
                 gsub (tagIn "[^" tagOut "]*" tagOut, "")
                 print
                }
' file
Found:     key="abolesco"><form

abolēscō olēvī, —, ere, incept. aboleo, to decay gradually, vanish, disappear, die out: nomen vetustate, L.: tanti gratia facti, V.

This User Gave Thanks to RudiC For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cutting number from range in xml file

Hi folks, I need to find the following value: First,I need to find the starting section by finding the line: <process-type id="OC4J_RiGHTv_${SCHEMA_NAME}" module-id="OC4J"> Second,under this line I need to find the following line: <port id="rmi" range="3765-3776"/> And third,from this line... (4 Replies)
Discussion started by: nir_s
4 Replies

2. Shell Programming and Scripting

Cutting columns starting at the end of each line...

Hi Guys, Can you help me with a sed or a csh script that will have an output from the input below. Cutting the columns starting from the end of the line and not from the start of the line? Sample1 - The underscore character "_" is actually a space...i need to put it as underscore here coz... (2 Replies)
Discussion started by: elmer1503
2 Replies

3. Shell Programming and Scripting

Cutting a part of line till delimiter

here are the few scenarios... isoSizeKB text NOT NULL, reserved1 varchar(255), KEY `deviceId` (`deviceId`) `d5` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `dHead` enum('HistoryInfo','Diversion') COLLATE utf8_unicode_ci, `ePR` int(11) DEFAULT '0', PRIMARY KEY (`id`) ... (7 Replies)
Discussion started by: vivek d r
7 Replies

4. Shell Programming and Scripting

Closing XML tags in one line

Any one can help Example having an spml output as below (the complete one has more than 10000 tags): ============= <ts11> <msisdn>123</msisdn> <bcieID>TELEPHON</bcieID> </ts11> <ts21> <msisdn>987</msisdn> </ts21> ... ======= I want to have every tag closed in one line ... (10 Replies)
Discussion started by: hafidiw
10 Replies

5. Shell Programming and Scripting

How to add the multiple lines of xml tags before a particular xml tag in a file

Hi All, I'm stuck with adding multiple lines(irrespective of line number) to a file before a particular xml tag. Please help me. <A>testing_Location</A> <value>LA</value> <zone>US</zone> <B>Region</B> <value>Russia</value> <zone>Washington</zone> <C>Country</C>... (0 Replies)
Discussion started by: mjavalkar
0 Replies

6. Shell Programming and Scripting

Insert a new line between the XML tags?.

<TestLog> <TriggerAPI> <StartDate>Nov 16, 2012 6:34:02 AM com.satttest01.Response() </StartDate> <RequestType>SUCCESS: Send :</RequestType> <TranNumber>5210203</TranNumber> <TranId>8585319731207148</TranId> </TriggerAPI> <TriggerAPI> <StartDate>Nov 16, 2012 6:34:02 AM... (3 Replies)
Discussion started by: laknar
3 Replies

7. Shell Programming and Scripting

Shell Command to compare two xml lines while ignoring xml tags

I've got two different files and want to compare them. File 1 : HTML Code: <response ticketId="944" type="getQueryResults"><status>COMPLETE</status><description>Query results fetched successfully</description><recordSet totalCount="1" type="sms_records"><record... (1 Reply)
Discussion started by: Shaishav Shah
1 Replies

8. Shell Programming and Scripting

Cutting commas after the second occurrence in a line

Hello everyone, I am manipulating a large CSV file and am trying to read it into a program and started running into trouble. The have manually edited the file trying to make it correctly run through the program and have made progress. However, I am know stuck with an issue involving too many... (3 Replies)
Discussion started by: tastybrownies
3 Replies

9. Shell Programming and Scripting

Assiging to a variable after cutting from the input line

Hi all, I am reading from the file having entries like below 111.ABC.POT 6477.YHT.OIT Now I need to read each line and cut each line seperated by dot and print into the file . I tried below and it is not working . Please help while read READLINE do eval... (4 Replies)
Discussion started by: Hypesslearner
4 Replies
OnlinePayment::HTTPS(3pm)				User Contributed Perl Documentation				 OnlinePayment::HTTPS(3pm)

NAME
Business::OnlinePayment::HTTPS - Base class for HTTPS payment APIs SYNOPSIS
package Business::OnlinePayment::MyProcessor; use base qw(Business::OnlinePayment::HTTPS); sub submit { my $self = shift; #... # pass a list (order is preserved, if your gateway needs that) ( $page, $response, %reply_headers ) = $self->https_get( field => 'value', ... ); # or a hashref my %hash = ( field => 'value', ... ); ( $page, $response_code, %reply_headers ) = $self->https_get( \%hash ); #... } DESCRIPTION
This is a base class for HTTPS based gateways, providing useful code for implementors of HTTPS payment APIs. It depends on Net::HTTPS::Any, which in turn depends on Net::SSLeay _or_ ( Crypt::SSLeay and LWP::UserAgent ). METHODS
https_get [ \%options ] HASHREF | FIELD => VALUE, ... Accepts parameters as either a hashref or a list of fields and values. In the latter case, ordering is preserved (see Tie::IxHash to do so when passing a hashref). Returns a list consisting of the page content as a string, the HTTP response code and message (i.e. "200 OK" or "404 Not Found"), and a list of key/value pairs representing the HTTP response headers. The options hashref supports setting headers: { headers => { 'X-Header1' => 'value', ... }, } https_post [ \%options ] SCALAR | HASHREF | FIELD => VALUE, ... Accepts form fields and values as either a hashref or a list. In the latter case, ordering is preserved (see Tie::IxHash to do so when passing a hashref). Also accepts instead a simple scalar containing the raw content. Returns a list consisting of the page content as a string, the HTTP response code and message (i.e. "200 OK" or "404 Not Found"), and a list of key/value pairs representing the HTTP response headers. The options hashref supports setting headers and Content-Type: { headers => { 'X-Header1' => 'value', ... }, Content-Type => 'text/namevalue', } SEE ALSO
Business::OnlinePayment, Net::HTTPS::Any perl v5.12.4 2010-05-25 OnlinePayment::HTTPS(3pm)
All times are GMT -4. The time now is 10:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy