Questions tagged [xml]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
44 views

How to locate a file created through the eXist-db database tool eXide?

I'm trying to find a specific file: note.xml which eXide would seem to have saved. Where is it? I've tried: sudo find / -iname \*.xml | grep note and a few varieties. Perhaps it's not "saved&...
0
votes
1answer
23 views

How to extract specific node values without travesing via xmlstarlet

<xml> <email>asdadw@cutshort.io</email> <email>sadfasd@cutshort.io</email> <email>asdas@cutshort.io</email> <host> <ip>56....
-2
votes
0answers
13 views

Execute curl in command line, for sending image [closed]

i have a code like this, this code for uploading image to server test.com curl -X POST -H "Authorization: YOUR-API-KEY" -H 'Content-Type: image/jpg' --data-binary @myFilename.jpg https://...
-1
votes
1answer
39 views

How to extract mutliple text lines within xml file by using grep and/or sed

I am trying to extract some lines within a <w:t> tag in front and </w:t> tag at the end of the text I want, but im only getting the text within last tags and not the others. How can i do ...
1
vote
1answer
52 views

Awk File processing to get last processed weekday

My application which does processing based on input XML's, processes the input files and adds the status to status_file.txt after processing. I am writing a script to identify the last processed day ...
1
vote
3answers
40 views

Variables inside heredoc with multiple files

I have a heredoc with xml content, and I add the content of another file like this: bar file: <bar> $baz </bar> the script: bar=$(cat bar.xml) # this would be the ideal, of course it ...
0
votes
0answers
20 views

Run a new nmap based on masscan XML output

I'm scanning a entire network with masscan (because it is faster than nmap) and outputing to XML. There is a way to start an nmap based on the XML output? The idea is: Masscan scan the entire network ...
1
vote
3answers
81 views

how to search and replace PATH element with SED of xml file in bash

I would like to replace the current element inside example path tag from: ... <examples> <example path='/test/test123/test12345.txt'/> <examples> ... to ... <examples> <...
1
vote
0answers
29 views

Identify empty VALUE in XML files and return exit command?

For instance, I have an XML file with the below content and the "NAME" Author and Assignee(s) have empty "VALUE". The main aim is to implement a check that can be applied to find ...
3
votes
6answers
121 views

Using sed to replace substrings between specific tags

I want to combine two sed command in one and really don't know how to do it, I've tried multiple things without success. For the result I want all slash between a specific tag to be replaced with ...
-1
votes
1answer
42 views

How to find and replace string having numbers with another string having number

I have an xml tag like <bestAddressLine4></bestAddressLine4>. I want to convert that to <bestAddressLine4 /> I am using below command but it is not working. sed -i 's/<...
0
votes
0answers
9 views

pdf with form and send mail button that does not work in gnome

I have this pdf form to be filled anytime I need an additional and temporary worker in my restaurant (for example, an additional waiter). The PDF has been created by the government working agency and ...
1
vote
5answers
95 views

How to insert a newline character after each occurrence of a specific XML tag in a file?

How to insert a newline character after each occurrence of a specific XML tag in a file? My file has multiple tags </Data> and I want to insert a NewLine character after each </Data> tag I'...
0
votes
3answers
59 views

Read a word in XML between elements using sed command

I want to read a word between two xml elements using sed command. For e.g. in below xml, I want to read the number 1234567. <ns1:account> <ns2:name>Corporation</ns2:name> &...
1
vote
0answers
18 views

Is it possible to require both glob and magic specified in mimetype definition?

Given the following freedesktop shared-mime-info file: <?xml version="1.0" encoding="UTF-8"?> <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info&...
0
votes
3answers
59 views

Find xml tag and replace the text inside the tag to a parameter value multiple occurrences

Find a specific xml tag and replace the text inside tags to some parameterized value. Multiple occurrences need to be replaced. Sample file content: <a>abc</a> Current attempt: sed -i &...
0
votes
2answers
54 views

sed XML Starting from line x, return the line number of the next occurence

I am deleting sections of tags from an XML and need to find the end tag to stop at. Example XML <SearchPattern> <something></something> </SearchPattern> <OtherTag>&...
1
vote
3answers
122 views

sed remove lines in range

I have an xml file. I am trying to remove only the blank lines from a range of lines. In this example I want to check lines 55-57 and remove any blank lines. This needs to be done in a shell script ...
0
votes
1answer
75 views

How to install BaseX on CentOS?

How do I install basex on CentOS? [nsaunders@rolly ~]$ [nsaunders@rolly ~]$ sudo yum install basex Last metadata expiration check: 0:16:02 ago on Mon 15 Jun 2020 05:19:44 PM PDT. No match for ...
2
votes
2answers
104 views

Removing spaces and double quotes between XML tags

I would like to remove spaces and quotes from the value of XML tag <ns:tag2> in my XML file on Linux(spaces to be removed only for this tag not other places). Sample XML content looks like ...
1
vote
3answers
248 views

How to comment out contents in xml file using sed?

I am creating a bash script to setup tomcat server. I need to comment some contents from context.xml file. I tried with sed but not able match the contents. Here is full context.xml file: <?xml ...
0
votes
2answers
32 views

Replace underline in multiple XML files

In a directory with several XML files (there may be hundreds of files) I have a field called <import_url>. In this field it can happen that a URL has an underscore. I would like this underscore ...
0
votes
4answers
82 views

XML Data to CSV

Need some quick help as I am not able to get the desired output: 2020-05-19 19:03:07,135 INFO [Container : 8504] [HttpUtil.java]requestXML: <?xml version="1.0"? ><COMMAND><TYPE>...
0
votes
3answers
114 views

How to extract specific string from web url using sed command with curl command

Using Linux server I have a URL which generates the below data: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="/seriessnapshot.xsl"?> <timeSeries> <series ...
0
votes
1answer
31 views

Linux remove a occurrence of sentence from a file and add add start and end

I have a script that curl a command to sms gateway to send sms and get xml as response. Each response are appended to a single file for future xsltproc process for creating csv. A single response is ...
0
votes
1answer
152 views

How to convert curl response xml to plain/csv/xls for a total count

I have a script that send sms for a trigger using a sms gateway. The command to send sms used is curl as below: curl 'http://www.example.com/push/server.php?user=******&pass=*******&sid=******...
2
votes
5answers
200 views

Replace text in file with multiline string

I have an XML file containing, amongst other lines, <asd>blablabla</asd> and <dsa>-some stuff -other stuff final stuff.</dsa> I want to replace everything between the "asd" ...
0
votes
1answer
33 views

How to Search XML Block and Delete the same

This is my XML. <configGroup> <type>SERVER_CONFIG</type> <configProperty id="Server48"> <configProperty> <name>Server Name</name> <...
0
votes
1answer
91 views

I want to add a namespace prefix to the tags of the default name space of an XML document from the shell

I have a SVG file, which is an XML document: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" ...
0
votes
1answer
82 views

Split file based on beginning and end XML tag

Can split be used to split a file into multiple segments where the size of each segment is based on the number of matches of an XML element ? For example for below XML split when encounters of "<...
-1
votes
3answers
39 views

Insert lines after character

I have data in a long lined file example: <currency>USD</currency><amount>111</amount><amountf>111/amountf><recv_confirms>2</recv_confirms><fee>22&...
1
vote
1answer
38 views

Reading .xml files and writing out the information in a .txt file

I want to download river runoff (.xml) files from a ChartServer online and create a .txt file with the information by running a .sh script. But I'm having difficulty in getting the data out in the ...
0
votes
0answers
32 views

How to set while loop and define xml output as a condition to stop the loop from running?

I've been digging through a lot of feeds online for the past few days and I've found bits and pieces of what I'm trying to accomplish, but since I am very basic with scripting and xml I got stuck. I'...
2
votes
3answers
175 views

Fetching the string inside single quote

<source file='/home/anpham/Projects/vm-builder/30G'/> I tried to use sed command to extract the absolute path from the output above but the output doesn't trim the string. The following ...
0
votes
2answers
702 views

Reading XML and extract only value [duplicate]

What is the easiest way to extract just the value set in a XML file? For example the data in the XML file is <node name="host"> <map> <entry key="cipher_strength" value="low" /&...
0
votes
0answers
9 views

Extracting XML forming a resultset like format

I've encountered a case wherein I need to extract values from xml however, the tags are missing. To elaborate, I've manually finger-counted around 5 of the same elements however, one sibling node(...
2
votes
0answers
49 views

How to download media content from XML feeds

For the past few years, I've been using Newsboat for to follow RSS feeds with text, and a web-based RSS reader for feeds with images/videos/gifs. However, I'd like to bring all of my RSS feeds over to ...
0
votes
1answer
130 views

xmllint usage - having a hard time getting xml attributes

I'm in the process of retreiving some data from a xml file, it is actually a SSIS package file (dtsx). I've read about using xmllint, however I'm having a hard time retrieving what I want. I'd like ...
0
votes
0answers
6 views

Consolidate and sum EDI-like XML

I need an XSL that will sum amounts based on tag value until sequence ends. The data is EDI-like so records are tagged rather than hierarchically grouped. Take the following input as an example. &...
1
vote
2answers
506 views

Script to grep xml file and redirect output to files based off results

So i'm trying to write a simple script that'll parse a xml file and redirect output to a new file based off the name of the category it was found under. For example this is what the XML file looks ...
0
votes
2answers
46 views

Unix sed output coming pattern twice in replace

I've an XML file logback-spring.xml. Now, I want to replace string DEBUG with TRACE, wherever ref="logstash" occurs only in the next line. The input file looks like below: <logger name="com....
0
votes
1answer
85 views

insert a line into xml using xmlstarlet

I have an XML file which looks like so: <?xml version="1.0" encoding="UTF-8"?> <!-- Solr managed schema - automatically generated - DO NOT EDIT --> <schema name="default-...
0
votes
1answer
36 views

Regex groups not greedy?

Are sed matches always greedy? I am trying to use sed to append an XML comment into an XML file as early as possible, which is right after the XML declaration if there is one. Something like this, ...
0
votes
2answers
54 views

Structured data format to XML

I have some output in some structured data format that I need to convert into XML. My use case is that Palo Alto firewalls deliver configuration output via the command line interface which cannot be ...
2
votes
5answers
130 views

How can I extract strings from one file to insert (modified) in a different file?

problem is the following: I have an xml file with data and I am looking for a small part of the data to write it into a new file: content has been shortened by request: snippet if type=dhcp-client: ...
2
votes
3answers
86 views

How to sanitize XML attributes values

I have the XML like this: <string name="foo-bar">"bar-bar -bar"</string> <string name="asdf_qwe-rty" translatable="false">"Lorem ipsum"</string> Now, the name attribute can't ...
3
votes
1answer
882 views

How to remove nodes from XML file as command line?

I have an xml file that contains the tag </w:rPr> several times. It is used like this <w:rPr><w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/></w:rPr> However ...
-1
votes
2answers
92 views

how to append a line alignment with its previous line in linux?

I have many xml files. There is a line end with </autoReferenceLines>. The line may have different leading spaces in different files. I want to add a new line below that line with the same ...
0
votes
1answer
110 views

Ampersand problem in an xml file using shell script

I have an xml file which contains below <SummaryRecordMapping> <eName>Licensed Original MC TPE EXCESSIVE AUTH</eName> <jobs> <job> <SummaryRecordMapping> <...
0
votes
1answer
47 views

Variable not resolving in multi line string assignment

I'm trying to create a shell script which gives a Json block which is used further. The Json block consists of the dynamic components assigned as variables. Below is the code snippet failCount=$(cat ...

1
2 3 4 5
7