A simple, very flexible text format that stands for eXtensible Markup Language.
7
votes
1answer
141 views
Vim: Making XML text “pretty”
Is there an easy way within vi to make your XML text "pretty"?
For example:
I want this..
<person>
<name>Nick</name>
<age>26</age>
...
6
votes
2answers
748 views
Parsing XML's , JSON's and newer data file formats in UNIX using command line utilities
Unix environment has some excellent tools for parsing text in various forms. However off late the data is not in the regular set of formats(CSV,TSV,Record based or some other delimiter based) it used ...
5
votes
1answer
183 views
How can i split openbox `rc.xml` into multiple files?
I don't like big text configuration files. So, i'd like to split my rc.xml file into multiple files:
rc.xml
rc.keyboard.xml
rc.mouse.xml
4
votes
3answers
145 views
Delete XML node containing certain element
I want to remove all Placemarks from a KML file that contain the element <tessellate>. The following block should be wholly removed:
<Placemark>
...
4
votes
1answer
1k views
Substitute text with sed and keep part of the original text
I am trying to convert
<id>1</id>
<Name>ENTERPRISE RESOURCE PLANNING</Name>
to:
<column name="id">1</column>
<column name="Name">ENTERPRISE RESOURCE ...
4
votes
2answers
374 views
Reformatting a large number of XML files
I'm manipulating a large number of XML files scattered throughout a nested directory structure. I tried the following (which almost works):
$ find . -name "*.xml" -type f | xargs -- xmllint --format
...
4
votes
2answers
50 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:
...
4
votes
1answer
508 views
how to compare two xml files having same data in different lines?
I have two files have same data but in different lines.
File 1:
<Identities>
<Identity>
<Id>048206031415072010Comcast.USR8JR</Id>
...
4
votes
2answers
613 views
Parsing XML from a shell script
I have a datafile like this:
<Key name="com.ahsay.afc.cpf.UserGroup" content="" allowMultiple="Y">
<Value name="rsv-id" inheritParentAttribute="Y" type="string" data="1328200856753" ...
3
votes
2answers
511 views
Insert a multiline string into another string
I need to insert lines into an xml file :
Insert
<one>
</one>
into
<tags>
</tags>
To obtain
<tags>
<one>
</one>
</tags>
I tried this:
...
3
votes
1answer
872 views
Is there an XML file editor for Linux with grid view support?
I have been using Altova XML Editor on Windows for a long time. It has a wonderful feature that lets you view XML files in "grid view." This makes life easy when reading very complex XML. My question ...
3
votes
2answers
1k views
xmllint display values of more than 1 attributes in single execution
I am using xmllint to parse xml file which has several tags and each tag has several attributes. Sample structure as shown below:
<root>
<child attr1="abc" attr2="def" attr3="ghi" />
...
2
votes
1answer
186 views
VIM jump from one xml tag to the closing one
Is there a shortcut to jump from , e.g <XX> to </XX> ?
I already give it a try with '%' , but it doesn't work for this situation.
2
votes
1answer
445 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 ...
2
votes
4answers
186 views
Shell script or command to Strip text and Binary files excerpts from large Log Files
I need to remove a large binary file (PDF file) from a large log file which is generated daily.This is seriously hogging space on our servers.I need to remove the large PDF from the logs to make the ...
2
votes
2answers
526 views
regex replace text in xml file within node from the command line
I have an XML file and I would like to replace everything that is between the open and closing tag within multiple instances of the g:gtin node with nothing.
Is this possible from the command line, ...
2
votes
4answers
362 views
Clean up concatenated XML files
I'm trying to fix my Delicious export script to work with the new "trick" of only serving 1000 bookmarks at a time. The script concatenates results (XML) from multiple calls in a single file, and now ...
1
vote
2answers
218 views
Text processing: convert text of table of content into djvu bookmark format?
Usually in the table of content of a book, each line is for a chapter or section and ended with its page number, for example,
1 first chapter 10
1.1 first section 11
1.1.1 first subsection 12
1.2 ...
1
vote
1answer
320 views
Alternative to xmllint to check xml validity
Sometimes, I have to check the validity of some big xml files against a xsd file.
The biggest xml file I received had a size close to 1.5GB.
xmllint took all my RAM and almost all the swap space, for ...
1
vote
1answer
98 views
XML parsing using xmllint and customizing the output
I have xml file (say input.xml) of the following schema:
<?xml version="1.0"?>
<TagA>
<TagB>
<File Folder="FOLDER1M\1" File="R1.txt" />
</TagB>
...
1
vote
1answer
31 views
Is there a command line tool for validating RDF files?
I am looking for a substitution of the W3C RDF Validator, as it is broken, in addition I want something a bit more automated, such as a command line tool.
I have been using xmllint for checking XML ...
1
vote
1answer
102 views
show only tags of an xml document on the command line
Is there a command line command or utility I can use to show only the tag structure of an xml document? I looked at xmllint but I didn't see a switch to do it. For a structure like
...
1
vote
1answer
142 views
What editor can be used to provide highlighting for Mallard project files?
I normally switch between Geany, vim and Emacs (depending on my mood. LOL) when editing on a linux platform.
Recently, I have begun exploring the Mallard Project, but have been unable to find the ...
0
votes
2answers
159 views
How to find and replace a particular string in a specific line
I developed a code which find and replaces a specific string in all xmls under all subdirectories. But i dont want all occurances to be replaced. In entire xml, code should find the tag xyz and ...
0
votes
1answer
199 views
Parse JSON or XML on bootup
I'm compiling my own version of the linux kernel and I was wondering if there is any way to do parse a local XML or JSON file.
Thanks
0
votes
3answers
114 views
How to check well-formedness of 4GB XML file?
I want to check well-formedness of a big XML file. (about 4GB.)
However, when I try xmlwf, all it tells me is
filename.xml: Value too large for defined data type
What to do with it? Is there any ...
0
votes
1answer
331 views
How to parse XML to CSV with a shell script?
What is the ideal way to parse an .xml file into a .csv file that I could include with my shell scripts. I know bash cant do it but I'm unsure if I should try in awk or sed. I imagine a language ...
0
votes
2answers
187 views
Increment xml files with bash
A good mate on a forum had helped me with creating this script but everything Ive thrown at it outputs wrong and I do not know why or what is the issue. I ran all my script in ubuntu's terminal if ...
0
votes
1answer
199 views
Vim not showing garbage characters
I copied the content of an ant build.xml document from an .odt file to Vim editor. There were no garbage characters I could observe, but the build process failed due to incorrect XML tags.
I assume ...
0
votes
0answers
18 views
Remove referenced duplicate entries from XML file [migrated]
After hours beating my head against the wall, I decided this is [probably] not the job for a mere shell script.
There's a bug on Google Earth that makes loading KML files very slow: for almost every ...
0
votes
1answer
236 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 ...
0
votes
2answers
115 views
How to delete a line containing pattern which is first found after a specific pattern
I am writting a shell script to delete an entry from a specific group.
eg: file name is dest.xml
<domain id="1" group_name="group1">
<node id="ABC">
<node id="PQR">
...

