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

learn more… | top users | synonyms

2
votes
3answers
199 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?
1
vote
0answers
21 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
31 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
35 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 ...
1
vote
3answers
73 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
82 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
56 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
196 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
30 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
51 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 ...
0
votes
3answers
60 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
46 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
36 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
51 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> ...
0
votes
1answer
195 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
7 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
61 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
54 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
207 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
100 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" ...
1
vote
5answers
177 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
2answers
74 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
2answers
130 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"> ...
1
vote
3answers
1k 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 ...
2
votes
2answers
197 views

search for exact string in unix

I have a file, xyz.txt, which has one string per line. How do I search xyz.txt for an exact match? I get an input string, eg. defabc, from another app. If defabc is found, it should return true, else ...
1
vote
0answers
86 views

Convert / import flat file with multiple records, one variable per line

I am searching for an efficient way using (UNIX) command line tools to read a flat file into a(ny) database, perhaps after first converting to an intermediate structured format, for example XML or ...
3
votes
5answers
332 views

Efficient data extraction from multiple files to a single CSV file

I have a large collection of XML files with the same exact structure: $ cat file_<ID>.xml ... ... ... <double>1.2342</double> <double>2.3456</double> ...
1
vote
1answer
102 views

How to convert a generic xml format block to properties format String from an xml file using ksh script [closed]

With the conditions: I cannot use any XML parser tool as I don't have permission , read only My xmllint version does not support xpath, and I cannot update it , read only I dont have xmlstarlet and ...
2
votes
4answers
207 views

Change text in tag, but only tag is contained within a certain XML block

Using Git Bash, I'm trying to conditionally replace what's in the yrot tag in hundreds of files, but only if it belongs with a part name tag that pertains to wheel. // YES, change <part ...
0
votes
0answers
198 views

Need to test web service using curl or wGet in Shell Script?

I use SoapUI to verify my responses below are the sample details. I am planning to automate the processes in linux. How can I achieve it using curl? or wget? I would like to receive the result in a ...
0
votes
1answer
119 views

How to implement awk range pattern in fetching an xml block when the input parameter is in the middle of the block

I am trying to fetch an xml block like this: <machine name="sample1" min="1" max="10" idleTime="300" backend="ABC,XYZ"> <handler className="com.abc.xyz.qwerty.foo.FooBar" ...
0
votes
5answers
2k views

How to grep an xml block in an xml file using a keyword in ksh

I have a file Sample.xml which contains a lot of services inside it and the structure looks like this Notes: I cannot use any XML parser tool as I don't have permission , read only My xmllint ...
0
votes
0answers
34 views

awk search for string containing forward slash in variable [duplicate]

I'm searching for a string in a massive XML file. Snip: <sv:node sv:name="notfound"> <sv:property sv:name="jcr:primaryType" sv:type="Name"> ...
1
vote
3answers
1k views

How to decode base64 text in xml file in Linux?

I'm new in linux (shell). I need to decode base64 text in xml file using linux shell script. Could you please help me to write linux shell script for decoding the values of those tags where attribute ...
2
votes
1answer
279 views

How to replace “&” with “&amp;” except when already part of an XML entity?

I have a file (xml) with many &amp;/&lt;/&gt;/etc, but sometimes also some & characters by themselves. I want to change this symbol to &amp; without replacing the others. cat ...
0
votes
3answers
60 views

Awk formatting issue for XML

There is an issue with the output XML format due to Record separator (RS = "\n \n"). The group of data is separated by an empty line. Any suggestion would be very much helpful to obtain the desired ...
1
vote
2answers
240 views

Bash / Linux Tools for correcting xml

I am generating a set of 'xml' files from a 'csv' file. Some of the fields in csv file contain '&' and other invalid xml characters that need to be replaced with their appropriate xml counterpart ...
0
votes
2answers
2k 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
1answer
179 views

XML Microsoft Word Document

I have a .xml file generated by someone with MS Word and I cannot manage to open it with LibreOffice or other app or change its format. I tried to save a LibreOffice document as "Word 2003 xml" and ...
1
vote
1answer
72 views

How do I synchronize 2 xml files?

I have 2 xml files named 1k.xml and 1n.xml. The file 1k.xml contains some additional elements and data which are not there in 1n.xml. I want to copy whatever is absent in 1n.xml to it, so that both ...
1
vote
2answers
773 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 ...
2
votes
4answers
358 views

How to extract only a part of one line?

I want to extract the essid in a dump file from airodump-ng using grep. The part where I want to extract looks like this: <SSID first-time="Wed Feb 25 07:06:57 2015" last-time="Wed Feb 25 ...
0
votes
3answers
3k views

create XML file using bash script

I want create simple xml file using bash script ( not with dom ) but when I set value in the line then echo print the $lorem word and not the val lorem=LOL echo '<root><foo ...
1
vote
1answer
167 views

Openbox Syntax Error in ~/.config/openbox/rc.xml [closed]

I added a new keybinding to my rc.xml and now I get this message every time I log into Openbox. Also, the right-click menu does not work anymore either. Now I would have fixed the error myself, but ...
1
vote
0answers
88 views

Can gedit highlight element of svg stucture?

Gedit can show matching parenthesis. Can it do the same with tags of an SVG file ? For example when I mark <text> I need to find closing </text> tag.
0
votes
1answer
457 views

Update of XML value with xmlstarlet

I have file config.xml: <?xml version="1.0" encoding="utf-8"?> <widget xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" id="app" version="2.5" ...
1
vote
1answer
1k views

How do I get a list of the values of matching attributes using xmllint and xpath?

I'm trying to use xmllint to parse names of Solr cores from the configuration file. This works: xmllint --xpath /solr/cores/core/@name solr.xml |grep -Po '(?<=name=")[a-z-]+(?=")' And it returns ...
1
vote
1answer
1k views

Split very big xml file into little pieces with specific line number count

This is how I did to extract the first 100000 lines from my big xml file (2gb): head source.xml -n 100000 > part.xml How can I keep splitting them to 100000 line (or specific file size chunks) ...
2
votes
5answers
223 views

Re-order text on each line in a file

I'm processing a log file and I need reorder each line (not sort). The log file looks like this: 11-06-2014 - 10:49:06PM lat = 41.858657; lon = -91.345142 11-06-2014 - 10:49:49PM lat = ...