Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [xml]

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

0
votes
1answer
17 views

Generating a ssh Host config file out of a Supperputty XML file

I am building a script that generates an ssh config file out of a Supperputty XML Session config file. I don't know which tool could handle it better. I try to achieve it with awk, but I don't receive ...
0
votes
1answer
21 views

How to extract the URL from xml or any text file

My XML file; <settings version="2"> <setting id="TimeShift" default="true">0</setting> <setting id="Override" default="true">false</setting> <setting id="...
0
votes
1answer
36 views

Find and Replace in Unix - XML File

I have output XML file which has string in each line icn="1", this number inside the double quotes will be changing for every line. But this number is not incrementing in order, so i have to make ...
0
votes
2answers
40 views

Change value inside xml attribute using sed?

I have the following attribute: <client-version>1.2.8</client-version> How can I replace everything inside <client-version></client-version> to only change the value (1.2.8)? ...
-3
votes
3answers
97 views

script to translate xml to json

I have 5000 questions in txt file like this: <quiz> <que>The question her</que> <ca>text</ca> <ia>text</ia> <ia>text<...
-1
votes
1answer
62 views

Replacing a value in an XML document with another value taken from elsewhere in the document

Script: #!/bin/ksh tu=$(cat /export/home/a1016169/stack.txt;) tu1=$(echo "$tu" | awk '/EM_CLIENT_VERSION/{x=NR+17}(NR<=x){print}' | awk '/tu/{x=NR+1}(NR<=x){getline; print}' | awk -F= '{print $...
1
vote
2answers
55 views

SED replace string inside a string

I have the following script: originalLine='<com.whatsapp.voipcalling.VideoCallParticipantViewLayout android:id="@id/video_participant_views" android:layout_width="fill_parent" android:...
2
votes
5answers
75 views

SED remove spaces and line breaks

I have the following xml file: <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:enabled="false" android:orientation="horizontal" android:id="@id/action_container" ...
0
votes
1answer
29 views

Set bash variables from XML tags

I have the following xml file <root> <deviceID>IO238470374109730497</devicdeID> <KeyValuePairs> <KeyValuePair> <BASE-URL>site.com</BASE-URL> &...
1
vote
1answer
68 views

How to delete tags from xml

I have the following XML file: <?xml version="1.0" encoding="utf-8"?> <deviceID>IO238470374109730497</devicdeID> <KeyValuePairs> <KeyValuePair> <BASE-URL>...
0
votes
0answers
18 views

Match a string and delete the line which is part of that tag in xml using sed, awk, in liu [duplicate]

Need to search a string "oneFi institution="12345678"" and need to delete only the "value maxPAN="19" minPAN="4" prefix="528749"/" Actual: <oneFi institution="12345678"> <...
0
votes
2answers
40 views

Find a string in xml tag and delete a line which is part of match tag

Need to search a string <oneFi institution="12345678"> and need to delete only the <value maxPAN="19" minPAN="4" prefix="528749"/> Actual: <oneFi institution="12345678"> ...
-4
votes
2answers
48 views

Finding specific string in XML file and storing in another file [closed]

Text in input file is like this <title> <band height="21" isSplitAllowed="true" > <staticText> <reportElement x="1" y="1" ...
-4
votes
2answers
46 views

Extract content between tags which is having sub tag

Extract the desired content from the file using "xmlstarlet" or "sed" or "awk" or some similar tool. The process should refer the full name of the particular businessprocesses and then should just ...
-2
votes
1answer
46 views

Extract string followed by specific word/symbol

I have two lines as shown below in my input file input.txt and I need to extract claimStartDate from first line and claimEndDate from second line. <ProfessionalClaim paymentIndicator="P" ...
-2
votes
1answer
46 views

adding comment tag on XML file through unix

INPUT XML FILE: <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> <Dcn xmlns="http://schemas.test.com/2013/ClaimRequest" xsi:schemaLocation="http://schemas.test.com/2013/...
0
votes
1answer
61 views

xml_grep exclude element that contains an element

I'm trying to remove all elements from an XML file that contain a certain other element. Here's a very simplified version of what I'm trying to do. Suppose I have the XML file <RootEl> <...
-1
votes
3answers
74 views

how to find & replace a file path listed in a file

I have a file content as shown below. If a line has ".idt" word, then I need to check if there is a file path preceding it (eg: /bin/dir/test/abcdef.idt). If yes, then remove the file path and keep ...
2
votes
0answers
40 views

how to output html to a file with xmllint?

How do I get xmllint to output to a file? thufir@dur:~/xmllint$ thufir@dur:~/xmllint$ xmllint --html http://www.skynet.be/nieuws-sport/weer/mijn-weer?cityId=6450 --xpath '//div[@class = "tides"]' - ...
0
votes
2answers
476 views

Search and replace specific tag value in XML file with sed command

I have a task where by I have to manipulate an XML file through a bash shell script. Here are the steps: Query XML file for a value. Replace the value of a different element with the new value. ...
-2
votes
3answers
49 views

sed/awk string replacement with newline and tabs

I have an XML file that contains the following: <ipaddr>192.168.1.1</ipaddr> <subnet>24</subnet> The goal is to modify <ipaddr>192.168.1.1</ipaddr> to <...
0
votes
1answer
15 views

replacement of a string in xml

I am trying to replace folder name value in an xml file.I am searching with required pattern using grep and replace the folder name value which is DF_GCSS with ABC_DEF which comes from a variable....
2
votes
2answers
100 views

sed: extract lines until unmatched pattern

I am trying to extract lines from a file where the end string is different from the begin string I have the following input file in format: <item_id>6</item_id> <info1>abc</...
1
vote
1answer
55 views

Script for converting .org to .xml

I want to convert tree written in .org file to some XML code to generate graphic tree from it later (for example loading it to www.draw.io webpage). In order to do this I need a bash script which ...
-3
votes
2answers
234 views

Extract value from XML file using shell script [duplicate]

I have file filestore.xml from which I need to extract /local/armdata/data/filestore1, /local/armdata/data/filestore2. grep binariesDir filestore.xml <binariesDir>/local/armdata/data/...
1
vote
3answers
81 views

Bash output two results next to each other

I have an out from xmllint and egrep that I would like to print two fields next to each other. e.g. (xmlinput) xmllint --format | egrep reference\|sourcefile <reference>ItemX</reference> &...
0
votes
2answers
198 views

Using bash to replace html character entities in the xml file

I have a string like this in xml file: &lt;h3&gt;Styled here with: &lt;a href="$url('Product-Show','pid','107723102')$"&gt;FRS blo&lt;/a&gt;, &lt;a href="$url('Product-...
0
votes
3answers
72 views

How to remove content before a pattern in xml using unix

Source file example: <HDR></HDR><b></b><c></c> (XML file created in a single line) OR Source file example: <HDR> </HDR> <b> </b> <c&...
0
votes
1answer
40 views

using curl with ${=(System.nanoTime())} inside req.xml file

i want to be able generating system nano second sequence when using curl my code is like this: curl -X POST -H 'Content-type: text/xml' -d @req.xml server_URL > result.xml the req.xml contains ...
0
votes
1answer
463 views

xml parsing with pure bash

I need to parse an XML without an xmlparser, is this possible? I started with xmlstarlet, which works nice, but I can not use any real parser on that machine. I need it to be a one-liner. I just need ...
0
votes
2answers
91 views

remove anything between angle bracket including it [duplicate]

I have a very big text file ~ 105 G it's includes a lot of <XXXX> (angle brackets including text in between). I want to remove those brackets and text in between.
1
vote
1answer
30 views

Printing the contents between two strings that include escape characters (Linux/Bash)

I am trying to write a script that searches my server in many .app files and outputs the contents between two strings-- only outputting what occurs between the two strings. I am able to do this with ...
-2
votes
3answers
78 views

Need to parse XML file tag 'Asset Id' & associated child tags using a shell script?

I have the following XML that I'd like to parse/select the 'Asset Id' from using some method from the shell. <?xml version="1.0" encoding="UTF-8"?> <ns0:EcomAssetMetadataTransaction xmlns:...
-2
votes
2answers
83 views

How to use sed to extract from xml after doing a pattern match in one of the tags inside?

<Response <MessageID>ID:c3e2</MessageID> <Year>2018</Year> <ClntID>ABC</ClntID> <ParticipantID>12346789&...
0
votes
1answer
504 views

$1 not working with sed

I have a bunch of files that contain XML tags like: <h> PIDAT <h> O I need to delete everything what comes after the first <h> in that line, so I can get this: <h> For ...
2
votes
2answers
222 views

Insert new line after all occurrences of a pattern

I have a pmml file containing one line: <DataField dataType="string" name="class" optype="categorical"><Value value="y0" /><Value value="y1" /><Value value="y2" /><Value ...
-1
votes
2answers
114 views

Extract words from multiple strings using AWK/SED

I am looking for logic where in I am trying to extract words from multiple lines using AWK command in Linux Tried in multiple ways with AWK and SED but no results. Attached is the text file and ...
0
votes
4answers
1k views

Replace an XML attribute's value with the value of a shell variable

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE POWERMART SYSTEM "powrmart.dtd"> <POWERMART CREATION_DATE="12/01/2016 17:43:15" REPOSITORY_VERSION="184.93"> <REPOSITORY NAME="...
0
votes
2answers
109 views

grep or awk to extact xml from log based on search string

I have a log file which has XMLs being logged. I need to search and extract all XML's that have a specific string in the any one of the nodes. e.g. the log file will have mulitple xml's containing ...
3
votes
1answer
511 views

Unable to write changes to a file in Vim editor

I have a 100 GB of xml doc that I'm migrating to a database in waves. In vim, I can edit the file, but I'm unable to save changes with :wq, :q or :xx. I get the error message this file is read only - ...
1
vote
3answers
250 views

Find XML files with specific values

I have a folder with ~10K XML files. Each of them looks like this: ... <object> <name>Cat</name> </object> <object> <name>Cow</name> </object> ... The ...
-4
votes
2answers
57 views

Parsing 2 files

I'm trying to parse 2 Microsoft Office files called v64.hash and VersionDescriptor.xml. Keep in mind that the contents of the files will change with every Microsoft Office update. I would like to: ...
0
votes
1answer
55 views

grep stringset matching after certain word

I have an xml file and I like to grep whatever is after the word "user=". Let say, contents of the xml file is something like, id="2ZG66N" impl="BatchJob" type="BATCH" user="t2036sl" id="43EGTT"...
0
votes
4answers
207 views

need to join only certain lines of a xml file together [duplicate]

I would like to transform this XML to where only certain lines are joined together. This is so I can later grep only specific lines. If this XML used attributes, then the data would already be in 1 ...
0
votes
3answers
128 views

Sed/awk Regex : XML feed

I'm searching for a specific REGEX, 3 days I'm trying and trying but not founding the right answer. I need to delete specific parts of an xml feed, I tried with sed, awk and it's not working right. ...
-2
votes
1answer
497 views

Need to parse data from xml to shell script [closed]

Need to parse data from xml to shell script one aft another Requriment :- we need to take <FileSetfolder> as one record. XML may contain many <FileSetFolder> from Each <FileSetFolder&...
1
vote
2answers
57 views

MacOS: How can I insert a line into an XML file based on it's filename? [closed]

I don't have access to a pure linux box. I have a bunch of XML files that are missing a filename callout line. I need to insert that line at a specific place in the XML file and have the filename ...
0
votes
1answer
47 views

Text Processing: How to sort list by date delimited by a string

I want to sort contents of file.txt by date. The date to sort is in the fourth table data <td></td> tag E.g. Content of file.txt: <tr><td>some_name_here</td><td>...
1
vote
2answers
143 views

Identify empty xml files?

I have a requirement to identify and write all xml file names which are empty to a text file for reporting purpose. Empty , here means the xml file has the usual header tag <?xml version="1.0" ...
0
votes
1answer
538 views

extract xml tag value from the file to Variable

I Have a file. where I need to extract dataTemplate name. need a value in datalob=XXPFARCUDO_DATA <?xml version="1.0" encoding="windows-1252" ?> <dataTemplate name="XXPFARCUDO_DATA" ...