Sponsored Content
Top Forums Shell Programming and Scripting extract specific data from xml format file. Post 302158413 by 60doses on Tuesday 15th of January 2008 07:26:54 AM
Old 01-15-2008
Yea.. just got the stuff in the morning, and I only have merely 12hours before submitting the report. Gah.

Thanks for your reply, but your code is nice enough to extract out the time, and I won't be needing all. Need it to match these 2 cases:

1) LogEvent ID ="Timer Start"
2) <![CDATA[send messages

What if I just want to extract the whole LogEvent ID="Timer Start"?

From <LogEvent ID="Timer Start"> to </LogEvent>.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with shell script to extract data from XML file

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

sed or awk to extract data from Xml file

Hi, I want to get data from Xml file by using sed or awk command. I want to get the following result : mon titre 1;Createur1;Dossier1 mon titre 1;Createur1;Dossier1 and save it in cvs file (fichier.cvs). FROM this Xml file (test.xml): <playlist version="1"> <trackList> <track>... (1 Reply)
Discussion started by: yeclota
1 Replies

3. Shell Programming and Scripting

How to Append the specific data to the xml file

I have an xml file data as shown below: <impl name="Nortel" is-enabled="true"> <package-mappings> <const-mapping target-state="EndPoint" target-param="cfCNDSubscribed" constant-value="true"/> <const-mapping... (2 Replies)
Discussion started by: ravi_rn
2 Replies

4. UNIX for Dummies Questions & Answers

Extract a specific number from an XML file based on the start and end tags

Hello People, I have the following contents in an XML file ........... ........... .......... ........... <Details = "Sample Details"> <Name>Bob</Name> <Age>34</Age> <Address>CA</Address> <ContactNumber>1234</ContactNumber> </Details> ........... ............. .............. (4 Replies)
Discussion started by: sushant172
4 Replies

5. Shell Programming and Scripting

Data Extract from XML Log File

Please help me out to extract the Data from the XML Log files. So here is the data ERROR|2010-08-26 00:05:52,958|SERIAL_ID=128279996|ST=2010-08-2600:05:52|DEVICE=113.2.21.12:601|TYPE=TransactionLog... (9 Replies)
Discussion started by: raghunsi
9 Replies

6. Shell Programming and Scripting

Extract data from XML file

Hi , I have input file as XML. following are input data #complex.xml <?xml version="1.0" encoding="UTF-8"?> <TEST_doc xmlns="http://www.w3.org/2001/XMLSchema-instance"> <ENTRY uid="123456"> <protein> <name>PROT001</name> <organism>Human</organism> ... (1 Reply)
Discussion started by: mohan sharma
1 Replies

7. Shell Programming and Scripting

How to extract data from xml file using shell scripting?

Hi evry1, This is my 1st post in this forum.Pls help me I want to extract some data froma xml file which has 2000 lines using shell scripting. Actually my xml file has some "audio and video codes" which i need to arrange in a column wise format after extracting it using shell scripting.I... (4 Replies)
Discussion started by: arun_kohan
4 Replies

8. Shell Programming and Scripting

How to extract data from XML file using shell scripting?

Hi , I have input file as XML. following are input data #complex.xml Code: <?xml version="1.0" encoding="UTF-8"?><TEST_doc xmlns="http://www.w3.org/2001/XMLSchema-instance"> <ENTRY uid="123456"> <protein> <name>PROT001</name> <organism>Human</organism> ... (1 Reply)
Discussion started by: arun_kohan
1 Replies

9. Shell Programming and Scripting

Extract Data from XML file.

Hi Guys, I am in a need to extract data from a xml file. The XML file format is as below. <data jsxnamespace="propsbundle" locales=""> <locale> <!--Error messages starts--> <record jsxid="CHARPAIR001" jsxtext=" must be selected"></record> <record... (1 Reply)
Discussion started by: Showdown
1 Replies

10. Shell Programming and Scripting

Extract the specific tags in a XML file

Hello Shell Gurus, I have a requirement to get the specific tags from a XML file. Here is my code snippet <jdbc-system-resource> <name>SDPData Source</name> <target>AdminServer,osb_server1,soa_server1</target> ... (30 Replies)
Discussion started by: Siv51427882
30 Replies
IO::Async::Timer::Countdown(3pm)			User Contributed Perl Documentation			  IO::Async::Timer::Countdown(3pm)

NAME
"IO::Async::Timer::Countdown" - event callback after a fixed delay SYNOPSIS
use IO::Async::Timer::Countdown; use IO::Async::Loop; my $loop = IO::Async::Loop->new; my $timer = IO::Async::Timer::Countdown->new( delay => 10, on_expire => sub { print "Sorry, your time's up "; $loop->stop; }, ); $timer->start; $loop->add( $timer ); $loop->run; DESCRIPTION
This subclass of IO::Async::Timer implements one-shot fixed delays. The object implements a countdown timer, which invokes its callback after the given period from when it was started. After it has expired the Timer may be started again, when it will wait the same period then invoke the callback again. A timer that is currently running may be stopped or reset. For a "Timer" object that repeatedly runs a callback at regular intervals, see instead IO::Async::Timer::Periodic. For a "Timer" that invokes its callback at a fixed time in the future, see IO::Async::Timer::Absolute. EVENTS
The following events are invoked, either using subclass methods or CODE references in parameters: on_expire Invoked when the timer expires. PARAMETERS
The following named parameters may be passed to "new" or "configure": on_expire => CODE CODE reference for the "on_expire" event. delay => NUM The delay in seconds after starting the timer until it expires. Cannot be changed if the timer is running. A timer with a zero delay expires "immediately". remove_on_expire => BOOL Optional. If true, remove this timer object from its parent notifier or containing loop when it expires. Defaults to false. Once constructed, the timer object will need to be added to the "Loop" before it will work. It will also need to be started by the "start" method. METHODS
$expired = $timer->is_expired Returns true if the Timer has already expired. $timer->reset If the timer is running, restart the countdown period from now. If the timer is not running, this method has no effect. EXAMPLES
Watchdog Timer Because the "reset" method restarts a running countdown timer back to its full period, it can be used to implement a watchdog timer. This is a timer which will not expire provided the method is called at least as often as it is configured. If the method fails to be called, the timer will eventually expire and run its callback. For example, to expire an accepted connection after 30 seconds of inactivity: ... on_accept => sub { my ( $newclient ) = @_; my $watchdog = IO::Async::Timer::Countdown->new( delay => 30, on_expire => sub { my $self = shift; my $stream = $self->parent; $stream->close; }, ); my $stream = IO::Async::Stream->new( handle => $newclient, on_read => sub { my ( $self, $buffref, $eof ) = @_; $watchdog->reset; ... }, on_closed => sub { $watchdog->stop; }, ) ); $stream->add_child( $watchdog ); $watchdog->start; $loop->add( $watchdog ); } Rather than setting up a lexical variable to store the Stream so that the Timer's "on_expire" closure can call "close" on it, the parent/child relationship between the two Notifier objects is used. At the time the Timer "on_expire" closure is invoked, it will have been added as a child notifier of the Stream; this means the Timer's "parent" method will return the Stream Notifier. This enables it to call "close" without needing to capture a lexical variable, which would create a cyclic reference. Fixed-Delay Repeating Timer The "on_expire" event fires a fixed delay after the "start" method has begun the countdown. The "start" method can be invoked again at some point during the "on_expire" handling code, to create a timer that invokes its code regularly a fixed delay after the previous invocation has finished. This creates an arrangement similar to an IO::Async::Timer::Periodic, except that it will wait until the previous invocation has indicated it is finished, before starting the countdown for the next call. my $timer = IO::Async::Timer::Countdown->new( delay => 60, on_expire => sub { my $self = shift; start_some_operation( on_complete => sub { $self->start }, ); }, ); $timer->start; $loop->add( $timer ); This example invokes the "start_some_operation" function 60 seconds after the previous iteration has indicated it has finished. AUTHOR
Paul Evans <leonerd@leonerd.org.uk> perl v5.14.2 2012-10-24 IO::Async::Timer::Countdown(3pm)
All times are GMT -4. The time now is 10:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy