A simple, very flexible text format that stands for eXtensible Markup Language.

learn more… | top users | synonyms

0
votes
2answers
48 views

Extracting data from tags in XML resultset

I need to fetch data for 2 tags "estimated" and "fullSign" for all the occurences on this result set. RESULT SET: <?xml version="1.0" encoding="UTF-8"?> <resultSet xmlns="urn:trimet:...
0
votes
0answers
30 views

how to grep a tag value in xml file and print another two tag values in same xml file

I want to grep tag value of and if its 01 it must print another tag and along with its value . Sample XML file : <CustName>Unix</CustName> <CustomerId>999</CustomerId> &...
3
votes
2answers
277 views

How to parse an xml file in a shell script

I would like to know how can I split my data from the following format: <datas> <data> <name>Name1</name> </data> <data> <name>Name2</name> <...
1
vote
2answers
56 views

How to change values in XML file

I have an XML file like below. I want change the values at is-required place and default-value place of each argument name using a shell script.. where argument name=protocol then is-required = "...
1
vote
5answers
69 views

Getting substrings in between delimiters multiple times from one string without looping

I have looked all over for a solution to this, but I couldn't find one. I am using qstat -x to pass a large string of job information. The output from qstat -x is in XML format. The substrings I am ...
1
vote
1answer
42 views

Loop through read only .zip data archive to extract line from .kml file within [duplicate]

I am trying to access some satellite data on a read only archive. I am only interested in files with certain co-ordinates listed in a .xml within the zip that match my research area. There are ...
3
votes
1answer
54 views

List names of files containing a string that occurs between two other strings

I need to print a list of files with match a specific pattern -- a string occurring between two other strings. How do I do that. I don't want to extract text, just list the files that match this ...
0
votes
0answers
32 views

Significance of shell script with XML

I have recently joined anew project and experienced the structure where Shell scripts are usually directed to a target which is set in XML and that XML containing action in the tags which needs to be ...
2
votes
5answers
94 views

Replacement of XML based on attribute content using sed

I've got to replace some attribute content in an XML tag, depending on a parameter $1. We've got in input, for example: <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="OO ...
2
votes
2answers
82 views

How can I append a # in front of each line of a block of text?

This is part of my PHP Myadmin's configuration file: Alias /phpMyAdmin /usr/share/phpMyAdmin Alias /phpmyadmin /usr/share/phpMyAdmin <Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-...
0
votes
2answers
52 views

Adding crlf character in xml file

I am trying to FTP a text file which is generated on unix server to Mainframe dataset. The file is generated as text file by extracting data in queue. The configuration is done via XML file like below:...
1
vote
0answers
55 views

How to sort XML elements in-place?

I'm trying to version control IntelliJ IDEA configuration files. Here's a small sample: <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="...
0
votes
1answer
25 views

Perl code to refer to multiple file of the same extension (.xml)

I'm trying to parse multiple xml files but i'm a bit stuck with something. The $twig->parsefile("output_1.xml"); section of the below script works fine in parsing the file stated. However, I would ...
0
votes
1answer
249 views

Parse xml returned from curl within a bash script

I've been digging through stackexchange for the past few days and I've found bits and pieces of what I'm trying to accomplish, but I'm unsure how to put it all together... I'm trying to create a ...
0
votes
2answers
53 views

Remove string with > and forward-slash from xml code

I want to remove two strings globally from some xml code. They are: </sellingStatus> and <sellingStatus> I have tried the following unsuccessfully: sed -i 'sed -i 's/</...
0
votes
2answers
56 views

Remove string with spaces and quotes from xml file

I would like to remove the string currencyId="GBP" from an xml file. Please note there is a single space before the first letter c. I am having trouble parsing the data and removing this string ...
-1
votes
2answers
43 views

Need help in removing XML Tags with empty properties

Input File: <ServiceArea type="STATE" value="DC"> <DaylightSavingsUsed value="true"/> <FemtoSipProxyAddress value="10.13.123.100"/> <TermAuthAAAPSK value="secret1"/&...
0
votes
1answer
13 views

Create Multiple libvirt Volumes From One XML File

I'm using libvirt's virsh vol-create command to create multiple volumes. I've started using Jinja2 templates to help with automating the task for a specific application. In my case, it would help ...
0
votes
0answers
31 views

Preventing Termination of Script on Error

The script below is used to parse thousands of files which are located in multiple directories. However, some of xml files which need to be parsed have errors files. The script below terminates in the ...
0
votes
3answers
85 views

How can I escape special characters in a sed “sub-command”?

I'm using xmllint --shell on a large XML file, and using the write command to write out an XML snippet to be used in testing. The snippet that gets written out needs a couple of lines from the ...
0
votes
0answers
36 views

Curl ebay multi page ebay api xml to a single text file

I am using the curl -K url.txt > output.txt command to transfer the xml output of an ebay api search to a text file. The search I am performing is multi page, but I am unsure how to export ...
0
votes
2answers
45 views

Is there any tools that will let me check String length of XML Node

Am wondering if there are any tools that will do this: Exmaple XML: <node1> <Data> <Unique>123456789-1234567891</Unique> </Data> </node1> What i was hoping ...
-1
votes
3answers
47 views

Extract value from XML

I have this XML: <results><testsuites><testcase name="XXXX (XXXXX)" time="20.3817"><result>success</result></testcase><total_time value="20.3830" /></...
2
votes
2answers
104 views

Script to modify XML config file

I'm trying to automate an installation process with a script. Part of the process is finding certain sections of the XML config file (seen below), and changing certain parameters from false to true or ...
2
votes
3answers
311 views

awk : parse and write to another file

I have records in XML file like below. I need to search for <keyword>SEARCH</keyword> and if present then I need to take the entire record and write to another file.(starting from <...
0
votes
1answer
20 views

Marking up symbols in a programming language

Given a text file with source code in some language, does anyone know of a command-line tool to markup symbols like identifiers, comments etc and output an XML document?
2
votes
0answers
118 views

How to count nodes and get attribute value without using xpath

Currently I have a shell script like this: LOGIN=`curl 'https://www.ponta.jp/u/LWAS900/SLWAS900010.htm' -sS | grep '<input type="hidden" name\|<form\|</form'` for i in $(seq $(printf "$...
1
vote
1answer
110 views

XMLstarlet for JSON?

Is there a tool that is similar to XMLstarlet but works on JSON instead of XML? My usecase: extract certain values from hierarchical JSON documents, as they are returned by some REST APIs. Something ...
1
vote
1answer
119 views

Retrieve attribute value from xml with namespaces using xmllint

I want to retrieve attribute value, using xpath option (without using xmllint' shell). my xml: <?xml version="1.0" encoding="UTF-8"?> <XML> <hhi:Elem xmlns:hhi="http://www.w3.org/...
1
vote
3answers
381 views

Add content of XML file to another one using bash script

I have two XML file first one ~/tmp/test.xml second one /data/myuser/.mycontent/mytest.xml I want to add all of the content on the first XML file to line 35 in the second one. I tried the following ...
0
votes
1answer
259 views

Parsing xml into array using xmllint

I have xml file with multiple <db> elements, I need to extract attributes from each node and do some work on them. IS it possible to load them to array, using ksh and xmllint ? This is what I ...
2
votes
3answers
152 views

extract blocks of text from xml file with a condition

I want to extract the contents of fqdns from the following file, but only for each device where status is new: <device id='10.72.48.215'> <address>10.72.48.215</address&...
1
vote
3answers
169 views

How to add tag for xml from file exist using shell linux

xml1.xml <app> <bbb> <jjj>test1</jjj> </bbb> <bbb> <jjj>test2</jjj> </bbb> </app> xml2.xml file2 ...
1
vote
4answers
314 views

Modify an SVG file based on information in a CSV file

I've got a SVG file of the map of the US and I want to add colors to it. Because it would take me to much time, I thought I could use a bash script. I have also another file containing the states and ...
1
vote
1answer
49 views

Validate a list of xml files

I'd like to validate a list of xml files against a schema, and only be notified of failures. This command seems to work, but the last grep command has no effect: find -iname "*.xml" | xargs xmllint -...
0
votes
0answers
115 views

Arch Linux: yaourt budgie-desktop xml error

When trying to install the AUR (Arch User Repository) package "budgie-desktop" by running the command "yaourt -S budgie-desktop", I'm getting an odd error about an xml file: Command '['/tmp/yaourt-...
0
votes
3answers
102 views

Edit an xml file - Find a string then Delete a block of text / Find a string then Insert a new block of text

Morning All, I'm new to UNIX so looking to do something I can do in VB but don't have the experience to do in UNIX. I have an xml spec on a share which requires regular deletion and updates as new ...
2
votes
4answers
52 views

How to append a line that does not start with '<' to the previous line

I have a log which contains XML lines. Sample format below: <head> <body> <line> asdasd</line> </body> </head> I want to scan the log file and ...
1
vote
1answer
87 views

Remove tag and contents based on child tag and add a new content - Shellscript xml

Can anyone please guilde me with this. I am trying to locate a particular tag, based on it child's contents and remove the parent tag and contents and add a new contents, but cant find an answer. ...
4
votes
3answers
55 views

Inserting a text between 2 patterns

I have a .xml file which contains the below <controller-host></controller-host> <controller-port></controller-port> <tier-name></tier-name> <node-name></...
0
votes
1answer
869 views

How to fix “cannot find -lxml2” error while installing 'igraph' for python?

On Ubuntu 15.04 I am trying to install 'igraph' using the following command: pip install python-igraph in order to, well, use the igraph package in python to work with graphs and stuff. However, ...
0
votes
0answers
11 views

IzPack - TargetPanel.noWhitespaces not working

I'm using IzPacK 5.0.5 version and i want to remove spaces in the TargetPanel to have a destination folder without spaces. I found that creating variable in install.xml file using this tag <...
-1
votes
1answer
109 views

how can i fetch a value from a text which is an incomplete xml file and then store it in a variable

I am having an issue while formatting an incomplete XML file in to a proper tagged XML, so that I can easily fetch the XML value inside a tag from it. Output text is like this: Input parameters ...
0
votes
0answers
68 views

IzPack Linux Keep same permissions

I'm using IzPack to pack my application contain thousand of files that should be executable. IzPack remove the original permissions and give the unpacked files rw-rw-r-- So, there is any solution to ...
2
votes
2answers
351 views

alter a line and remove tag using perl from xml file?

I have an xml file (client_23.xml) in which I need to alter one line and remove one whole tag from it so I came up with perl script: In my xml file, I have a block like this. There will be only one ...
1
vote
2answers
180 views

How to remove a line from a tag in shell script?

We have an xml file (abc_lop.xml) in which I need to remove a line which is present in a tag: Below is an xml file, I have shorten it down as it is very big. <HELLO version="4.2" xmlns="http://...
1
vote
5answers
223 views

lines to columns with awk

I have to following sample output: <HARDWARE> <NAME>WIN1</NAME> <OS>Windows 7</OS> <IP>1.2.3.4</IP> <DOMAIN>contoso.com</DOMAIN> &...
1
vote
3answers
144 views

filter text xml file

I have a big (with couple of hundred thousands records) XML file from which I'd like to filter only specific fields. example of the file construction: <A> <id>123</id> <B> &...
3
votes
2answers
230 views

Can I convert fields in XML to tags using xmlstarlet?

I want to convert fields in Tags to tags within that tag for example <book name="Data Structure" price="250" pages="350"/> To <book name="Data Structure"> <price>250</price&...
1
vote
3answers
2k views

How to add an attribute in a tag in XML file by command-line?

I am trying to add field at the end of tag using sed script. Suppose I have a tag in XML file: <book name="Sed tutorial" price="250"/> Now I want to add field as Book_Width="A" after end of &...