Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Using sed to substitute between quotes. Post 302327581 by Franklin52 on Monday 22nd of June 2009 07:34:58 AM
Old 06-22-2009
Try this:

Code:
sed 's/\(.*image href=\)[^ ]*\( .*\)/\1"NEW_VALUE"\2/'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sed substitute situation

I am having a problem executing a sed substitute in a file. I have tried alot of different things I found in previous posts, however non seem to work. I want to substitute this in $FILE: VALUE=33.4 In the script I have tried the following: prev=$(awk -F"=" '{ print $2 }' $FILE ) new=$(echo... (16 Replies)
Discussion started by: newbreed1
16 Replies

2. Shell Programming and Scripting

Using SED to substitute between two patterns.

Hi All, I'm currently using SED to make various changes to some .xml files I'm working on, but I'm stuck on this particular problem. I want to remove '<placeholder>element-name</placeholder>' from the following: <heading>Element <placeholder>element-name</placeholder> not... (2 Replies)
Discussion started by: Steve_altius
2 Replies

3. Shell Programming and Scripting

Using sed to substitute first occurrence

I am trying to get rid of some ending tags but I run into some problems. Ex. How are you?</EndTag><Begin>It is fine.</Begin><New> Just about I am trying to get rid of the ending tags, starts with </ and ending with >. (which is </EndTag> and </Begin>) I tried the following sed... (2 Replies)
Discussion started by: quixoticking11
2 Replies

4. Shell Programming and Scripting

How to substitute the value with in double quotes in perl?

Hi, I have string like this: $str=' DNA OR ("rna AND binding AND protein")'; I just wanted to substitute AND with a blank. How can i do that? I want the output like this: $string= DNA OR ("rna binding protein") (3 Replies)
Discussion started by: vanitham
3 Replies

5. Shell Programming and Scripting

how to substitute filepaths with sed or awk?

I am having the following problem. I am having a lot of files (test_1_01.hea, test_1_02.hea, etc) with the content: project_directory /net/1/d_1/5/ tmp_directory /net/1/d_1/5/ material_directory /net/1/d_1/5/ And I have to substitute the filepaths with new counted ones where the... (3 Replies)
Discussion started by: ergy1983
3 Replies

6. Shell Programming and Scripting

using sed or gsub to substitute characters!

Is there a way to substitute the URL-encoding references of ( & and ` ) with their actual appearance? for example.... %26 is & say I want to convert every %26 in my file to &..... awk '{gsub(/%26/,"&");print}' Is there a way to do this? I also want to be able to convert ` too! (3 Replies)
Discussion started by: puttster
3 Replies

7. Shell Programming and Scripting

How to substitute a varible in script having value including quotes?

Hi All, We need to run a Connect direct script on Unix server to send a file to Mainframe server and at mainframe end there need to run another job through Runtask with some parameters need to be passed from C:D (unix) to mainframe. My question is I have to pass parameters like DSN and FNAME as... (2 Replies)
Discussion started by: matrix001
2 Replies

8. Shell Programming and Scripting

sed substitute command -- need help

I am trying to do what I thought should be a simple substitution, but I can't get it to work. File: Desire output: I thought I'd start with a sed command to remove the part of the header line preceding the string "comp", then go on to remove the suffix of the target string (e.g. ":3-509(-)"),... (3 Replies)
Discussion started by: pathunkathunk
3 Replies

9. Shell Programming and Scripting

[sed]: Substitute a string with a multiline value

Dear all, I try to replace a string of characters in a file (MyFile.txt) by a multiline value of the variable "Myvar": $ cat MyFile.txt DESCRIPTION '@TargetTable SCHEMA' ( @InputFlowDef ); $ The content of Myvar: $ echo "$Myvar" col1 , col2 , col3 $ (4 Replies)
Discussion started by: dae
4 Replies

10. UNIX for Beginners Questions & Answers

Substitute a character with sed

hi all, i'd like to modify a file with sed , i want to substuite a char "-" with "/" how can i do this? Thanks for all regards Francesco (16 Replies)
Discussion started by: Francesco_IT
16 Replies
XML::Atom::Atompub(3pm) 				User Contributed Perl Documentation				   XML::Atom::Atompub(3pm)

NAME
XML::Atom::Atompub - Extensions of XML::Atom for the Atom Publishing Protocol SYNOPSIS
use XML::Atom::Entry; use XML::Atom::Feed; use XML::Atom::Atompub; my $entry = XML::Atom::Entry->new; # <app:edited>2007-01-01T00:00:00Z</app:edited> $entry->edited('2007-01-01T00:00:00Z'); # <app:control><app:draft>yes</app:draft></app:control> my $control = XML::Atom::Control->new; $control->draft('yes'); $entry->control($control); # <content type="image/png" src="http://example.com/foo.png"/> my $content = XML::Atom::Content->new; $content->type('image/png'); $content->src('http://example.com/foo.png'); $entry->content($content); # <link rel="alternate" href="http://example.com/foo.html"/> $entry->alternate_link('http://example.com/foo.html'); my $feed = XML::Atom::Feed->new; # <link rel="self" href="http://example.com"/> $feed->self_link('http://example.com'); METHODS of XML::Atom Some elements are introduced by the Atom Publishing Protocol, which are imported into XML::Atom by this module. $entry->control([ $control ]) Returns an XML::Atom::Control object representing the control of the Entry, or "undef" if there is no control. If $control is supplied, it should be an XML::Atom::Control object representing the control. For example: my $control = XML::Atom::Control->new; $control->draft('yes'); $entry->control($control); $entry->edited([ $edited ]) Returns an atom:edited element. If $edited is given, sets the atom:edited element. $content->src([ $src ]) Returns a value of src attribute in atom:content element. If $src is given, the src attribute is added. $atom->alternate_link([ $href ]) Returns a value of href attribute in atom:link element with a link relation of alternate. If $href is given, an atom:link element with a link relation of alternate is added. $atom->self_link([ $href ]) Returns a value of href attribute in atom:link element with a link relation of self. If $href is given, an atom:link element with a link relation of self is added. $atom->edit_link([ $href ]) Returns a value of href attribute in atom:link element with a link relation of edit. If $href is given, an atom:link element with a link relation of edit is added. $atom->edit_media_link([ $href ]) Returns a value of href attribute in atom:link element with a link relation of edit-media. If $href is given, an atom:link element with a link relation of edit-media is added. $atom->related_link([ $href ]) Returns a value of href attribute in atom:link element with a link relation of related. If $href is given, an atom:link element with a link relation of related is added. $atom->enclosure_link([ $href ]) Returns a value of href attribute in atom:link element with a link relation of enclosure. If $href is given, an atom:link element with a link relation of enclosure is added. $atom->via_link([ $href ]) Returns a value of href attribute in atom:link element with a link relation of via. If $href is given, an atom:link element with a link relation of via is added. $atom->first_link([ $href ]) Returns a value of href attribute in atom:link element with a link relation of first. If $href is given, an atom:link element with a link relation of first is added. $atom->previous_link([ $href ]) Returns a value of href attribute in atom:link element with a link relation of previous. If $href is given, an atom:link element with a link relation of previous is added. $atom->next_link([ $href ]) Returns a value of href attribute in atom:link element with a link relation of next. If $href is given, an atom:link element with a link relation of next is added. $atom->last_link([ $href ]) Returns a value of href attribute in atom:link element with a link relation of last. If $href is given, an atom:link element with a link relation of last is added. SEE ALSO
XML::Atom XML::Atom::Service AUTHOR
Takeru INOUE, <takeru.inoue _ gmail.com> LICENCE AND COPYRIGHT
Copyright (c) 2007, Takeru INOUE "<takeru.inoue _ gmail.com>". All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. perl v5.14.2 2012-04-04 XML::Atom::Atompub(3pm)
All times are GMT -4. The time now is 06:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy