Sponsored Content
Full Discussion: Modify xml using sed or awk
Top Forums Shell Programming and Scripting Modify xml using sed or awk Post 302898155 by Scrutinizer on Saturday 19th of April 2014 06:39:38 AM
Old 04-19-2014
Try
Code:
awk '$1=="name" {f=($2=="GoogleOverhaul")?1:0} f && $1~/"staging"/{$2="off"}1' RS=\< ORS=\< FS=\> OFS=\> file

If it gets more complicated it may be better to use specializer XML tooling....


--
@balajesuri: that will change all staging elements to "off"
This User Gave Thanks to Scrutinizer For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

modify and use awk sed program

The following awk script creates a file b.dat. awk '{print substr($0,1,27),substr($2,index($2,"_")+1)," ",substr($0,49)}' a.dat > b.dat I need this script to be modified to also sum $3 values by distinct $1 and $2 fields. Current file W2_2009275 2 8 W2_2009275 2 7 W1_2009275 1... (3 Replies)
Discussion started by: mnnarendra
3 Replies

2. Shell Programming and Scripting

parsing xml with awk/sed

Hi people!, I need extract from the file (test-file.txt) the values between <context> and </context> tag's , the total are 7 lines,but i can only get 5 or 2 lines!!:confused: Please look my code: #awk '/context/{flag=1} /\/context/{flag=0} !/context/{ if (flag==1) p rint $0; }'... (3 Replies)
Discussion started by: ricgamch
3 Replies

3. Shell Programming and Scripting

Sed or Awk for modify hour in a crontab AIX

Hi, I want to modifiy the hour in the crontab AIX 5.3 for this line: Input: 00 22 * * * /outillage/script_exploit/bin/SavOffline.ksh > /dev/null 2>&1 Output: 30 20 * * * /outillage/script_exploit/bin/SavOffline.ksh > /dev/null 2>&1 With the awk or sed function through a ssh -q... (1 Reply)
Discussion started by: khalidou13
1 Replies

4. Shell Programming and Scripting

Using SED/AWK to extract xml at end of file

Hello everyone, Firstly i do not require alot of help.. i am right at the end of finishing my scipt but cannot find a solution to the last part. What i need to do is, prompt the user for a file to work with, which i have done. promt the user for an output file - which is done. #!/bin/bash... (14 Replies)
Discussion started by: hugh86
14 Replies

5. Shell Programming and Scripting

Need help in using sed/awk for line insertion in xml

Hello, I have two text files (txt1 and txt2). txt1 contains many lines with a single number in each line. txt2 (xml format) contains information about the numbers given in txt1. I need to insert one line in txt2 within the scope of each number taken from txt1. Sample problem: txt1: 12 23... (1 Reply)
Discussion started by: shekhar2010us
1 Replies

6. Shell Programming and Scripting

XML- Sed || Awk Bash script... Help!

Hi ! I'm working into my first bash script to make some xml modification and it's going to make me crazy lol .. so I decide to try into this forum to take some ideas from people that really know about this! This is my situation I've and xml file with a lots of positional values with another tags... (9 Replies)
Discussion started by: juampal
9 Replies

7. UNIX for Dummies Questions & Answers

xml to csv using sed and awk command

Hi Guys, Can you help me in creating shell script using sed,awk etc commands to generate csv file using xml file. (5 Replies)
Discussion started by: sbk
5 Replies

8. Shell Programming and Scripting

Modify the file with awk,sed or perl

Hi All, I need help from any of you.Would be so thankful for your help. I/P DDDD,1045,161,1557,429,1694,800,1911,1113,2460,1457,2917> 1609,3113,1869,3317,2732,3701,3727,4132,5857,5107> 9004,6496 DDDD,1125,157,1558,429,1694,800,1911,1117,2432,1444,2906>... (2 Replies)
Discussion started by: Indra2011
2 Replies

9. Shell Programming and Scripting

Using awk and sed to modify a create sql script

Hi, I have a file which contains the following data claim_src|clm_id,typ_id pat_src|pat_id prov_src|prov_id,clm_id,prov_name The first field is table name and second field is primary keys of the table Now I have three files which contain ddl of each table. clam_src.sql... (4 Replies)
Discussion started by: wahi80
4 Replies

10. UNIX for Beginners Questions & Answers

Sed, awk or another bash command to modify string with the content of another file

Hello everybody, I would like modify some strings using sed or another command line with the content file. For example: - {fqdn: "server-01" , ip: "server-01"} - {fqdn: "server-02" , ip: "server-02"} - {fqdn: "server-03" , ip: "server-03"} - {fqdn: "server-04" , ip: "server-04"} My... (4 Replies)
Discussion started by: dco
4 Replies
dhcpv6db2conf(1M)														 dhcpv6db2conf(1M)

NAME
dhcpv6db2conf - DHCPv6 client database converter SYNOPSIS
[lan_interfaces] DESCRIPTION
provides a means of translating the DHCPv6 client database, into a set of standard configuration file variables. The client database con- sists of a series of records. Each record represents a unique lan interface and a list of attributes, which correspond to that interface. The attributes are configuration parameters like: host's IP address, NTP server address, address of the DHCPv6 server, NIS domain name etc for that interface. With you can list the contents of the database to the screen, create a set of configuration staging files, or execute direct edits on existing configuration files using the values contained in the client database. Options allows you to specify a list of lan interfaces on the command line (e.g. whose data needs to be translated to a readable format. If no lan interface is specified, will process the entries of all interfaces which are UP. The attributes can be selected for processing by specifying a combination of one or more filter flags on the command line. If no filter flag is specified, all the attributes for that lan interface will be processed. The following options are supported: Using the results of the specified filter, directly apply the variable definitions to the existing configuration files (for example, Create a set of staging files using the results of the selected filter(s). Each variable processed will be applied to its corresponding staging configuration file. Specifically, will generate a copy of the existing configuration file. For example, will be copied to Once this staging file has been created, the variable that is being processed will be applied to this newly created file. Print results to the screen (stdout), this is the default action if neither nor are specified. Process the INTERFACE variable set [IPV6_SECONDARY_INTERFACE_NAME, IPV6_ADDRESS, IPV6_PREFIXLEN, DHCPV6_ENABLE]. Process the DNS variable set [domain, nameserver]. Process the SIP server address and SIP domain name information. Process the NIS variable set [NIS_DOMAIN, YPSET_ADDR]. Process the vendor specific information. Print the DHCPv6 server address. lan_interfaces lan interfaces such as whose data needs to be translated to a readable format. If not specified, will process the entries of all interfaces which are UP. Configuration Files and Variable Names The following files and variables can be processed: IPV6_SECONDARY_INTERFACE_NAME IPV6_ADDRESS IPV6_PREFIXLEN DHCPV6_ENABLE NIS_DOMAIN YPSET_ADDR domain / search nameserver EXAMPLES
To list the entire contents of the DHCP client database type: To list only the INTERFACE variable set for type: AUTHOR
was developed by Hewlett-Packard. FILES
Client configuration database SEE ALSO
dhcpv6clientd(1M), dhcpv6client_ui(1), dhcpv6d(1M). dhcpv6db2conf(1M)
All times are GMT -4. The time now is 06:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy