Sponsored Content
Full Discussion: sed xml file script help
Top Forums Shell Programming and Scripting sed xml file script help Post 302975587 by J-Man on Wednesday 15th of June 2016 06:43:07 PM
Old 06-15-2016
I'm running on AIX, but get an error message "cannot be parsed"

Code:
AIX an05074 1 6 00F61FD34C00
$ sed '/AUTOEDIT EXP/{s//VARIABLE NAME/; s/=/" VALUE="/2}' test.xml
sed: 0602-404 Function /AUTOEDIT EXP/{s//VARIABLE NAME/; s/=/" VALUE="/2} cannot be parsed.

---------- Post updated at 05:43 PM ---------- Previous update was at 05:28 PM ----------

Thank you both, got it working.

Code:
#!/bin/ksh
inXML=$1
outXML=${inXML:?}.v9.xml

sed -e \
"s/AUTOEDIT EXP/VARIABLE NAME/g" -e \
"/VARIABLE NAME/s/=/\" VALUE=\"/2" < ${inXML} > ${outXML}

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extracting XML file using sed

Hello folks I want to extract data between certain tag in XML file using 'sed' <xml> ......... .......... <one>XXXXXXXXXXXXXXXXXXXX</one> ...... Anyone ?Thank you (7 Replies)
Discussion started by: pujansrt
7 Replies

2. UNIX for Advanced & Expert Users

Parsing xml file using Sed

Hi All, I have this(.xml) file as: <!-- define your instance here --> <instance name='ins_C2Londondev' user='' group='' fullname='B2%20-%20London%20(dev)' > <property> </property> </instance> I want output as: <!-- define your instance here --> <instance... (3 Replies)
Discussion started by: kapilkinha
3 Replies

3. Shell Programming and Scripting

How to remove xml namespace from xml file using shell script?

I have an xml file: <AutoData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Table1> <Data1 10 </Data1> <Data2 20 </Data2> <Data3 40 </Data3> <Table1> </AutoData> and I have to remove the portion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" only. I tried using sed... (10 Replies)
Discussion started by: Gary1978
10 Replies

4. Shell Programming and Scripting

Remove sections of a xml file with sed

I've been trying to remove some lines of a xml file that looks like this: <parent> <child>name1</child> <lots_of_other tags></lots_of_other_tags> </parent> <parent> <child>name2</child> <lots_of_other tags></lots_of_other_tags> </parent> <parent> <child>name3</child> ... (5 Replies)
Discussion started by: viniciusandre
5 Replies

5. Shell Programming and Scripting

XML file modifications using sed

Hi, During an installation process in a bash script I need to do 2 things with 2 XML files. Does the use of sed affect in any way the XML file ? 1.Add to a section in <ServerListeners> section <ServerListener> <BaseClass>myapp.module.WowConfigurator</BaseClass> </ServerListener> The... (2 Replies)
Discussion started by: potro
2 Replies

6. Shell Programming and Scripting

sed parse small xml file

I have a tmp.xml file like: <?xml version="1.0" encoding="UTF-8"?> <Response> <Ip>193.143.121.198</Ip> <Status>OK</Status> <CountryCode>PL</CountryCode> <CountryName>Poland</CountryName> <RegionCode>82</RegionCode> <RegionName>Pomorskie</RegionName> <City>Gdansk</City> ... (9 Replies)
Discussion started by: unclecameron
9 Replies

7. Shell Programming and Scripting

How to get value from xml node using sed/perl/script?

hello, new to this forum. but i have a requirement to extract the value from multiple xml node and print out the values to new file with comma seperated. would like to know how this would be done using either sed/perl or some unix script. an example would be tremendous... sample input file:... (2 Replies)
Discussion started by: davidsouk
2 Replies

8. Shell Programming and Scripting

Help in parsing xml file (sed/nawk)

I have a large xml file as shown below: <input> <blah> <blah> <atr="blah blah value = ""> <blah> <blah> </input> ..2nd chunk... ..3rd chunk... ...4th chunk... All lines between <input> and </input> is one 'order' and this 'order' is repeated... (14 Replies)
Discussion started by: shekhar2010us
14 Replies

9. 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

10. Shell Programming and Scripting

sed - extract text from xml file

hi, please help, i have an xml file, e.g: ... <tag> test text asdas="${abc}" xvxvbs:asdas${222}sdad asasa="${aa_bb_22}" </tag> ... i want to extract all "${...}", e.g: ${abc} ${222} ${aa_bb_22} thank you. (2 Replies)
Discussion started by: gioni
2 Replies
CTL(5)                                              CTL file format of ASIM/LIP6/CAO-VLSI lab.                                              CTL(5)

NAME
ctl - Control Temporal Logic file format. ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in Paris, France. Web : http://asim.lip6.fr/recherche/alliance/ E-mail : alliance-users@asim.lip6.fr DESCRIPTION
This document describes the CTL file format used by moka(1) for model checking of finite states machine description. This CTL file format subset is defined to enable classical CTL formulae description. A CTL file is made of two parts: a declaration part and a formulae statement part. The declaration part described types, constants, macros and all variables used in CTL formulae. It also describes assumption conditions and initial conditions that have to be applied by moka(1) during the model checking. The formulae statement part described all the CTL formulae that have to be verified. All boolean and relational VHDL operators are supported (see vbe(5)) and also the 8 CTL operators AF, AG, AX, AU, EF, EG, EX and EU. The CTL file format support also the imply boolean operator '->' and the equivalence operator '<=>'. EXAMPLE
-- user type definition TYPE A_ETAT_TYPE IS (A_E0, A_E1); TYPE B_ETAT_TYPE IS (B_E0, B_E1); -- variables definition VARIABLE A_NS, A_CS : A_ETAT_TYPE; VARIABLE B_NS, B_CS : B_ETAT_TYPE; VARIABLE ck : BIT; VARIABLE data_in : BIT; VARIABLE data_out : BIT; VARIABLE reset : BIT; VARIABLE ack : BIT; VARIABLE req : BIT; -- example of a macros definition DEFINE def1 : BOOLEAN := ack='1'; -- the assigned value can be a constant DEFINE c1 : BIT := '1'; -- the assumption condition ASSUME ass1 := (reset='0'); -- the initial reset condition -- be careful, the assumption condition is not applied -- to the initial conditions. RESET_COND init1 := (reset='1'); -- It is also possible to describe the first state -- with the INITIAL keywork, as follows: -- -- INITIAL init1 := ((A_CS=A_E0) AND (B_CS=B_E0)); -- -- formulae description statement part begin prop1 : EX( ack='1' ); prop2 : AG( req -> AF( ack ) ); prop4 : AU( req='1', ack='1'); end; SEE ALSO
moka(1) BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory. We need your feedback to improve documentation and tools. ASIM
/LIP6 August 5, 2002 CTL(5)
All times are GMT -4. The time now is 12:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy