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

learn more… | top users | synonyms

1
vote
1answer
26 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
76 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
33 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
41 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
113 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
233 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
96 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
40 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
78 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
76 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
89 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
41 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
171 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
225 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
938 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
73 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
68 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
209 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
377 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
631 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
190 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 = ...
0
votes
3answers
652 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
407 views

Convert XML to SQL INSERT statements using the command line

Is there a way to convert XML to SQL INSERT using the command line, here is examples: <something> <somthingelse>lol</somethingelse> </something> would be INSERT INTO ...
1
vote
1answer
2k views

Confused about how to convert XML to CSV using xmlstarlet on OS X?

I asked a question earlier and it was closed as being a duplicate: How to parse XML to CSV with a shell script?. The answer in the duplicate that was linked suggested using a tool called XMLStarlet, ...
3
votes
0answers
109 views

Convert Evolution filters.xml file to Thunderbird msgFilterRules.dat?

I migrated evolution to Thunderbird yesterday. I googled for migrate filters, but Evolution stores them as an XML file and Thunderbird stores using a Mork formatted file such as: version=`9` logging= ...
0
votes
1answer
126 views

How do I replace the '&#x5c' with '/' in file using the command line?

After grep line with AAA/BBB/CCC but the output file consists only the line as AAA"& #x5c;"BBB"& #x5c;"CCC.. How do I fix this?
0
votes
2answers
548 views

Making A Shell Script To Write To XML File

I am writing a shell script to make writing my RSS a whole lot easier. Right now I am stuck at how to properly edit my files. See, I want the program to take in data from me, and then save those to ...
1
vote
2answers
241 views

How to remove nodes from a HUGE (>2gb) XML file?

I'm working with several huge (>2gb) XML files and their size is causing problems. (My application uses XMLReader in a PHP script to parse smaller ~500mb files, and that works fine, but XMLReader ...
0
votes
1answer
49 views

How to get ids from xml file into mysql?

I've got 8 xml files and need to do some work on these records in mysql. What is a good way to get these IDs into mysql? <?xml version="1.0" encoding="utf-8"?> <Records> <Record> ...
4
votes
5answers
436 views

Insert Lines after Multi-Line Regex Match

I've got an XML file I need to append to after a specific set of tags. Basically the file structure looks like this: <key>servers</key> <dict> ... Server Details ... </dict> ...
2
votes
2answers
701 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
2answers
84 views

search and replace string

I have a XML tag for example <tag name="abc"></tag> I wanted to replace the string inside "" with the tag name i.e the upper XML tag should be become now <abc ...
3
votes
1answer
1k 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.) ...
1
vote
1answer
279 views

Why isn't this XMLStarlet Query Working?

I'm trying to write a simple bash script that parses price info from the ebay developer API search results. Here's an example of XML search results for "Detective Comics 700": ...
4
votes
6answers
1k views

sed first n occurrences result set between 2 tags / patterns

I have a big XML file and I get all occurrences between 2 tags: Here is what I do: sed -n '/<tag>/,/<\/tag>/p' file.xml And I need to filter to get only first N occurrences. I've ...
2
votes
1answer
68 views

XML command line tool postgres

I have an XML files to read and load into database daily at night (cron) So i planed to do this in a batch. Is there any command line tool to : 1. Create a postgres schema using an XSD file? 2. ...
2
votes
1answer
75 views

Substite values from file1 to file2 awk

I have input file in xml FILE1 : <Sector sectorNumber="1"> <Cell cellNumber="1" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/> ...
0
votes
1answer
858 views

XML modify and writing to file beautiful soup

I am using python beautiful soup to parse an XML file and write it to a different file after deletion of certain tags. But, using soup.prettify changes other XML namespaces and attribute names. f = ...
0
votes
1answer
234 views

python xml parsing

I have to delete particular tags from an xml file. Sample xml below. <data> <tag:action/> </data> I want to delete all contents between data and /data. ...
0
votes
2answers
234 views

How to format xml attributes, not just elements

How do you format an XML document to make it easy to read element attributes? I have a xml based webservice that returns one or two elements, but with hundreds of attributes. As I'm doing ...
1
vote
2answers
118 views

Egrep multiple strings in an XML file

I have a collection of XML files in a standard format that I'd like to search to see if they match two strings. Here is the idea: <ELEMENT1>Dave</ELEMENT> ...
1
vote
3answers
109 views

Use Unix tools to look for a definition block in an XML.

I am using an XML that has definitions in this form - <definition name="ticketOpen" extends="ticketUpdate"> <put name="title" value="Open Ticket" /> <put name="mainForm" ...
1
vote
1answer
427 views

Parsing an xml RSS feed file

What I would like to achieve is to receive an email with the failures of my VPS. I tried to do that by downloading an rss feed XML file from my VPS provider which contains all the failures, down ...
1
vote
1answer
2k views

How to find out the content of a XML file using Unix Sed/Awk? [duplicate]

I have a XML file(MyXML.xml) like this : <?xml version="1.0" encoding="UTF-8"?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> ...
5
votes
5answers
32k 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 ...
2
votes
1answer
202 views

How can I setup ~/.tidyrc file for XML?

How do you configure tidy to parse XML instead of HTML? Explanation: A while ago, a co-worker showed me a trick to use tidy to clean up XML. Apparently, you create a tidyrc file like so: ...
1
vote
1answer
585 views

Modify XML file based on partial name

I've been using Xmlstarlet to modify some .xml files but I am lost trying to figure out how to modify a tag based on a partial name. What is the best way to comment out an entire line that begins ...
-2
votes
1answer
175 views

Get values in an XML File - Requirement : It must be done in bash/Unix [closed]

Sorry If this question has already been asked but I did not find my answer yet. Here is an extract of my XML file : <Value ProtectInMemory="True"> ...
4
votes
2answers
75 views

How to add a line from a list into another file when a specified line is found?

Basically I have 2 files. One has a list of router and switch login prompts, like this: user@router1 user@router2 user@switch1 user@switch2 The other file has blocks of XML, like this: ...