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

learn more… | top users | synonyms

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 ...
1
vote
1answer
37 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
51 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
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,...
0
votes
0answers
30 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
4answers
75 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
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
81 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
103 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
38 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
41 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
23 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
134 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
48 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
52 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
10 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
31 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
30 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
77 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
35 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
41 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
116 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
87 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 ...
-1
votes
1answer
39 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
3answers
290 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
101 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
95 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
103 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
331 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
229 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
150 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
294 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
45 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
50 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
89 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
81 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
245 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 ...
3
votes
1answer
3k views

Convert xml subtitle file to srt format

I have a xml subtitle that looks like this: <?xml version="1.0" encoding="utf-8" ?><transcript> <Item from="1.16" duration="4.68"><![CDATA[(Dong-hyuk is coming to see you now.) ...
0
votes
1answer
727 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
99 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
65 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 ...
1
vote
2answers
164 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://...
2
votes
2answers
328 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 ...