Sponsored Content
Top Forums Shell Programming and Scripting Search and replace in xml file using awk.. Post 302399540 by rdcwayx on Sunday 28th of February 2010 09:08:33 PM
Old 02-28-2010
Code:
sed 's/<Password>x<\/Password>/<Password>y<\/Password>/' sample.xml

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk - replace number of string length from search and replace for a serialized array

Hello, I really would appreciate some help with a bash script for some string manipulation on an SQL dump: I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump. This is quite easy with sed: sed -e... (1 Reply)
Discussion started by: otrotipo
1 Replies

2. Shell Programming and Scripting

Search for word in a xml file and replace it with something else

Hello Unix Users, I am very new to Unix so I am not sure how do I do the following. I need a script such that when I type the following in the command prompt > . scriptName.sh wordToBeReplaced DirectoryLocation will find the word someword located in a somefile.xml in DirectoryLocation... (8 Replies)
Discussion started by: 5211171
8 Replies

3. Shell Programming and Scripting

awk search and replace and overwrite file

hi, i am doing awk '{gsub("hello", "bye", $0); print}' test.dat but I want to actually store the results of this global change into the file test.dat itself, i.e. I don't want the results to come to stdout, I want the results to overwrite the initial file how can I do this? thanks (3 Replies)
Discussion started by: JamesByars
3 Replies

4. Shell Programming and Scripting

text file search and replace with awk

hello all greeting for the day i have a text file as the following text.xml abcd<FIELD>123.456</FIELD>efgh i need to replace the value between <FIELD> and </FIELD> by using awk command. please throw some light on this. thank you very very much Erik (5 Replies)
Discussion started by: erikshek
5 Replies

5. Shell Programming and Scripting

Help needed :Search and Replace a string pattern with empty in an xml file in unix

Search and Replace a string pattern with empty in an xml file in unix: My xml file would be like this : <Accounts><Name>Harish</Name><mobile>90844444444444445999 </mobile><TRIG>srcujim-1</TRIG></Accounts><Accounts><Name>Satish</Name><mobile>908999</mobile><TRIG>ettertrtt-1</TRIG></Accounts> ... (1 Reply)
Discussion started by: harish_s_ampeo
1 Replies

6. Shell Programming and Scripting

Mutli line pattern search & replace in a xml file

Hello guys, I need your help for a specific sed command that would search for a multi line pattern and if found, would replace it by another multi line pattern. For instance, here is the input: <RefNickName>abcd</RefNickName> <NickName>efgh</NickName> <Customize> ... (0 Replies)
Discussion started by: xciteddd
0 Replies

7. Shell Programming and Scripting

Search and replace from file in awk using a 16 bit text file

Hello, Some time ago a helpful awk file was provided on the forum which I give below: NR==FNR{A=$0;next}{for(j in A){split(A,P,"=");for(i=1;i<=NF;i++){if($i==P){$i=P}}}}1 While it works beautifully on English and Latin characters i.e. within the ASCII range of 127, the moment a character beyond... (6 Replies)
Discussion started by: gimley
6 Replies

8. Shell Programming and Scripting

Search and replace the string with new word using xml tags

Hi All i need to replace the url1 inside <remote> tag in below xml in first instance and in the second instance with url2. any help appreciated <locations> <hudson.scm.SubversionSCM_-ModuleLocation> <remote>https://svn2015.com/svn/repos/internalshard</remote> ... (4 Replies)
Discussion started by: madankumar.t@hp
4 Replies

9. Shell Programming and Scripting

sed search and replace after xml tag

Hi All, I'm new to sed. In following XML file <interface type='direct'> <mac address='52:54:00:86:ce:f6'/> <source dev='eno1' mode='bridge'/> <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> ... (8 Replies)
Discussion started by: varunrapelly
8 Replies
GJOTS2DOCBOOK(1)					      General Commands Manual						  GJOTS2DOCBOOK(1)

NAME
gjots2docbook - Convert a gjotsfile to DOCBOOK (on stdout) SYNOPSIS
gjots2docbook -a|-b [ -e ] [ -P ] [ -p ] [ gjotsfile ] DESCRIPTION
gjots2docbook converts a gjotsfile into DOCBOOK XML. gjots2docbook uses awk(1) to perform the conversion. gjots2docbook does not create them so the first element in the file should contain any <bookinfo> or <artheader> element. Similarly, <bib- liographic> elements are not created. In fact the output is very simplistic with item titles in the gjotsfile being converted to chapter or section headings in DOCBOOK. There is no reason why your gjotsfile should not contain valid DOCBOOK XML - and that is why the -e and -p op- tions are provided. If the file does not start with <?xml ...> then appropriate lines will be added as follows: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE doc_type PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"> If properly installed, the docbook utilities can then be used to create HTML, man, ps, pdf etc files eg: gjots2docbook -b ~/.gjotsfile >gjotsfile.xml docbook2pdf gjotsfile.xml It may be necessary to fine-tune the docbook formatting to access all features. OPTIONS
-a makes a DOCBOOK article -b makes a DOCBOOK book -e don't encode special characters eg < -> &lt; -p don't change blank lines to </para><para> markers -P first section is a preface rather than a chapter (book only) AUTHOR
Written by Bob Hepple <bhepple@freeshell.org> http://bhepple.freeshell.org/gjots COPYRIGHT
Copyright (c) 2002 Robert Hepple This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PAR- TICULAR PURPOSE. SEE ALSO
gjots(1), gjots2html(1), docbook2gjots(1) GJOTS2DOCBOOK(1)
All times are GMT -4. The time now is 05:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy