07-02-2018
Quote:
Originally Posted by
Ophiuchus
How can I say. It works just exactly as I was looking for.
I tested changing the "delete array[i]" sentences to outside for loop as "delete array" and it works too.
Many thanks for your help again.
The standards specify that every conforming version of
awk must support
delete array[subscript]. Some implementations of
awk also support
delete array, but that is not required by the standards. On systems that do not support
delete array, you can use
split("", array) to get the same effect.
So, if you're trying to write code that will work on every implementation, avoid using
delete array. If you're just writing code to be used on your current system,
This User Gave Thanks to Don Cragun For This Post:
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello Scripting Gurus,
I need help with extracting data from the XML file using shell script.
The data is in a large XML and I need to extract the id values of all completedworkflows. Here is a sample of it. Input and output data is also in the attached text files.
<wfregistry>... (5 Replies)
Discussion started by: yajaykumar
5 Replies
2. Shell Programming and Scripting
I have a rather large file with XML-style content. Each line contains one full XML entry. For example:
1:<Message><DNIS>1234</DNIS><UCID>3456</UCID><TransferGroup>XYZXYZ</TransferGroup></Message>
2:<Message><DNIS>9999</DNIS><UCID>2584</UCID><TransferGroup>ABCABC</TransferGroup></Message>... (1 Reply)
Discussion started by: sharpi03
1 Replies
3. Shell Programming and Scripting
Hi All,
I am new to Unix I need a KSH script to get the values from XML file to write to a temp file.
Like the requirement is from the below TAG
<MAPPING DESCRIPTION ="Test Mapping" ISVALID ="YES" NAME ="m_test_xml" OBJECTVERSION ="1" VERSIONNUMBER ="1">
I need the MAPPING DESCRIPTION... (3 Replies)
Discussion started by: perlamohan
3 Replies
4. Shell Programming and Scripting
File1.xml
<?xml version.........>
- <abcd:abcd_list version="1" www.john_uncle's_server.com" xmlns:
- <device id="100">
<firmware>12.4(3d)</firmware>
<location id="500">Sitting Room</location>
</device>
- <device id="101">
<firmware>12.4(3d)</firmware>
<location id="501">Class... (1 Reply)
Discussion started by: sureshcisco
1 Replies
5. Shell Programming and Scripting
Hi,
I need to capture all the attributes with delete next to it. The source XML file is attached.
The output should contain something like this below:
Attributes = legacyExchangeDN
Action = Delete
Username = Hero Joker
Loginid = joker09
OU =... (4 Replies)
Discussion started by: prvnrk
4 Replies
6. Shell Programming and Scripting
Hello,
I have a requirement to extract the value from multiple xml node and print out the values to new file to compare.
Would be done using either awk/perl or some unix script.
For example sample input file:
.....
.....
<factories xmi:type="resources.jdbc:DataSource"... (2 Replies)
Discussion started by: slbmind
2 Replies
7. Shell Programming and Scripting
:wall: Hi,
I have an XML file with 5 tags. I need to pass values to the XML file from a shell script that will replace values in 2 of the tags. I cannot hardcode the tag values in XML and use replace command in script as the values are likely to change.
Please help !!!!!!!!!!! (2 Replies)
Discussion started by: Monalisaa
2 Replies
8. UNIX for Dummies Questions & Answers
hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file
<sequence>
<Filename>aldorzum.doc</Filename>
<DivisionCode>US</DivisionCode>
<ContentType>Template</ContentType>
<ProductCode>VIMZIM</ProductCode>
</sequence>... (1 Reply)
Discussion started by: sravanreddy
1 Replies
9. Shell Programming and Scripting
I am trying to extract specific XML attribute values for search pattern <factories.*baseQueueName' from resources.xml.
my scripts works ok,, but to extract 3 values this code does echo $line three times, it could be 'n' times. How can I use awk to extract matching pattern values in-line or... (11 Replies)
Discussion started by: kchinnam
11 Replies
LEARN ABOUT DEBIAN
stag-parse
STAG-PARSE(1p) User Contributed Perl Documentation STAG-PARSE(1p)
NAME
stag-parse - parses a file and fires events (e.g. sxpr to xml)
SYNOPSIS
# convert XML to IText
stag-parse -p xml -w itext file1.xml file2.xml
# use a custom parser/generator and a custom writer/generator
stag-parse -p MyMod::MyParser -w MyMod::MyWriter file.txt
DESCRIPTION
script wrapper for the Data::Stag modules
feeds in files into a parser object that generates nestarray events, and feeds the events into a handler/writer class
ARGUMENTS
-p|parser FORMAT
FORMAT is one of xml, sxpr or itext, or the name of a perl module
this is the class that parsers the input file(s) and generates stag events
xml assumed as default
-w|writer FORMAT
FORMAT is one of xml, sxpr or itext, or the name of a perl module
this is the class that catches the events thrown by the parser; it can be any class, but the class is typically a writer
xml assumed as default
-o|out FILE
the writer will use this file (defaults to STDOUT)
-e|errf FILE
file to store parse error handler output
-errhandler FORMAT/MODULE
FORMAT is one of xml, sxpr or itext, or the name of a perl module
all parse error events go to this module
-r|root NODE_NAME
if this is specified, NODE_NAME becomes the root of the stag tree, and anything that was previously the root is placed below this.
this happens automatically if more than one file is parsed (because there can only be one tree root)
-color
Works only if the output handler is able to provide ASCII-colors (currently supported for itext and xml)
SEE ALSO
Data::Stag
This script is a wrapper for the method
Data::Stag->parse()
perl v5.10.0 2008-12-23 STAG-PARSE(1p)