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> &...
0
votes
2answers
2k views

Failed dependencies trying to install package 'libxml2'

I am trying to install libxml2, but my system complains about dependencies. The dependent packages exist on system. The ultimate goal is to install xml_grep2, I have been trying various methods (cpan,...
1
vote
3answers
2k views

Split XML file into multiple files

I have an xml file that have different nodes, I want to split files like this: <unix> <mm> </unix> <osx> <nn> </osx> When I run the script I want it to make ...
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
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" /></...
0
votes
3answers
4k views

convert xml to csv

i need to convert a xml to csv using script. I found a solution with xmlstarlet but it is not available so i am returning to point 0. Here is my xml. <root> <record> <...
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> &...
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 ...
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 ...
9
votes
5answers
51k views

Parse XML to get node value in bash script?

I would like to know how I can get the value of a node with the following paths: config/global/resources/default_setup/connection/host config/global/resources/default_setup/connection/username ...
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 ...
1
vote
2answers
1k views

Adding new attribute to existing xml file using sed or awk

I have a xml file which contains below details: <server> <mbean code="WSMQConnectionFactory" name="service=MQQueueConnectionFactory"> <attribute name="JndiName">...
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
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
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 ...
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 ...
-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
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 ...
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&...
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 ...
3
votes
4answers
3k views

How do I actually read an XML file in human form that makes sense?

I downloaded a catalog and it is in XML format. How do change it from code to human-readable form, and ideally save it as a plain text file? I've never worked/seen these before; I tried messing with ...
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
260 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 ...
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 -...
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 ...
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 ...
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. ...
0
votes
1answer
250 views

Replacing all `&` but not the one in XML entity `&amp;` with `#` with sed in a given XML tag

I needed to replace all & with #, inside and only inside the <faultstring> ... </faultstring> tag. Additionally, the & in &amp; should not be changed. Sample input: 123&&...
2
votes
1answer
88 views

Substitute values from file1 to file2 awk

I have an input file in xml FILE1 : <Sector sectorNumber="1"> <Cell cellNumber="1" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/> ...
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></...
4
votes
3answers
5k views

How do I parse namespaces from an XML file using XMLLINT and BASH

Below I have an example of an Adobe XML swidtag used to track inventory. I need to parse out relevant information using xmllint in bash and output that to a new text file. For example I would like ...