Sponsored Content
Top Forums Shell Programming and Scripting Need row number with Xml tags value Post 302819683 by rajamadhavan on Tuesday 11th of June 2013 08:50:28 AM
Old 06-11-2013
If for some reason, you need perl only syntax, this will do

Code:
perl -nle 'print /(.+(?=\<\?xml version="1.0"\?\>))|((?<=\<Status\>).+(?=\<\/Status\>))/g' file_name

This User Gave Thanks to rajamadhavan For This Post:
 

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

how to add the number of row and count number of rows

Hi experts a have a very large file and I need to add two columns: the first one numbering the incidence of records and the another with the total count The input file: 21 2341 A 21 2341 A 21 2341 A 21 2341 C 21 2341 C 21 2341 C 21 2341 C 21 4567 A 21 4567 A 21 4567 C ... (6 Replies)
Discussion started by: juelillo
6 Replies

3. Shell Programming and Scripting

Replacing number between xml tags with ksh shell script

Hallo, im basically a complete noob on shell scripting and im trying to replace or rather add 1 to a number between xml tags. The xml basically has a tag somewhere that looks like this: <tag>12345678901234</tag> Now i want to replace the number between the tags. And i want the file to... (6 Replies)
Discussion started by: Demoric
6 Replies

4. Shell Programming and Scripting

How to arrange xml tags in single row using shell script?

I want to put one xml record in one row and so on... sample two records are here. <?xml version="1.0"?> <Object> <Header> <XCOMVers>V1.0</XCOMVers> <REPORT>XXXXX</REPORT> <CODE>002</CODE> </Header> <IssueCard> <Record> <L>CAR SYSTEM -SSSSS -</L> ... (1 Reply)
Discussion started by: sene_geet
1 Replies

5. Shell Programming and Scripting

How to arrange xml tags in single row using shell script?

I want to put one xml record in one row and so on... sample two records are here. <?xml version="1.0"?> <Object> <Header> <XCOMVers>V1.0</XCOMVers> <REPORT>XXXXX</REPORT> <CODE>002</CODE> </Header> <IssueCard> <Record> <L>CAR SYSTEM -SSSSS -</L> ... (3 Replies)
Discussion started by: sene_geet
3 Replies

6. Shell Programming and Scripting

The difference between end number in the early row and the start number in the next

Hi Power User, I'm trying to compute this kind of text file format: file1: jakarta 100 150 jakarta 170 210 beijing 220 250 beijing 260 280 beijing 290 320 new_york 330 350 new_york 370 420 tokyo 430 470 tokyo 480 ... (2 Replies)
Discussion started by: anjas
2 Replies

7. Shell Programming and Scripting

Shell Command to compare two xml lines while ignoring xml tags

I've got two different files and want to compare them. File 1 : HTML Code: <response ticketId="944" type="getQueryResults"><status>COMPLETE</status><description>Query results fetched successfully</description><recordSet totalCount="1" type="sms_records"><record... (1 Reply)
Discussion started by: Shaishav Shah
1 Replies

8. UNIX for Dummies Questions & Answers

Finding row number along with length of row

I have a fixed length file and I want to find out row number along with row length. I have a program that give me the line length if it satisfy the condition; but i would like to add row number as well? How do I do that? while IFS= read -r line; do if ; then echo ${line} echo... (8 Replies)
Discussion started by: princetd001
8 Replies

9. Shell Programming and Scripting

Get row number from file1 and print that row of file2

Hi. How can we print those rows of file2 which are mentioned in file1. first character of file1 is a row number.. for eg file1 1:abc 3:ghi 6:pqr file2 a abc b def c ghi d jkl e mno f pqr ... (6 Replies)
Discussion started by: Abhiraj Singh
6 Replies

10. Shell Programming and Scripting

Read row number from 1 file and print that row of second file

Hi. How can I read row number from one file and print that corresponding record present at that row in another file. eg file1 1 3 5 7 9 file2 11111 22222 33333 44444 55555 66666 77777 88888 99999 (3 Replies)
Discussion started by: Abhiraj Singh
3 Replies
Log::Report::Exception(3pm)				User Contributed Perl Documentation			       Log::Report::Exception(3pm)

NAME
Log::Report::Exception - a collected report SYNOPSIS
# created within a try block try { error "help!" }; my $exception = $@->wasFatal; $exception->throw if $exception; $@->reportFatal; # combination of above two lines my $message = $exception->message; # the Log::Report::Message if($message->inClass('die')) ... if($exception->inClass('die')) ... # same if($@->wasFatal(class => 'die')) ... # same DESCRIPTION
In Log::Report, exceptions are not as extended as available in languages as Java: you do not create classes for them. The only thing an exception object does, is capture some information about an (untranslated) report. METHODS
Constructors Log::Report::Exception->new(OPTIONS) -Option --Default message <required> reason <required> report_opts {} message => Log::Report::Message reason => REASON report_opts => HASH Accessors $obj->isFatal Returns whether this exception has a severity which makes it fatal when thrown. See Log::Report::isFatal(). example: if($ex->isFatal) { $ex->throw(reason => 'ALERT') } else { $ex->throw } $obj->message([MESSAGE]) Change the MESSAGE of the exception, must be a Log::Report::Message object. When you use a "Log::Report::Message" object, you will get a new one returned. Therefore, if you want to modify the message in an exception, you have to re-assign the result of the modification. example: $e->message->concat('!!')); # will not work! $e->message($e->message->concat('!!')); $e->message(__x"some message {msg}", msg => $xyz); $obj->reason([REASON]) $obj->report_opts Processing $obj->inClass(CLASS|REGEX) Check whether any of the classes listed in the message match CLASS (string) or the REGEX. This uses Log::Report::Message::inClass(). $obj->print([FILEHANDLE]) The default filehandle is STDOUT. example: print $exception; # via overloading $exception->print; # OO style $obj->throw(OPTIONS) Insert the message contained in the exception into the currently defined dispatchers. The "throw" name is commonly known exception related terminology for "report". The OPTIONS overrule the captured options to Log::Report::report(). This can be used to overrule a destination. Also, the reason can be changed. example: overrule defaults to report try { print {to => 'stderr'}, ERROR => 'oops!' }; $@->reportFatal(to => 'syslog'); $exception->throw(to => 'syslog'); $@->wasFatal->throw(reason => 'WARNING'); $obj->toString Prints the reason and the message. Differently from throw(), this only represents the textual content: it does not re-cast the exceptions to higher levels. example: printing exceptions print $_->toString for $@->exceptions; print $_ for $@->exceptions; # via overloading OVERLOADING
overload: stringification Produces "reason: message". SEE ALSO
This module is part of Log-Report distribution version 0.94, built on August 23, 2011. Website: http://perl.overmeer.net/log-report/ LICENSE
Copyrights 2007-2011 by Mark Overmeer. For other contributors see ChangeLog. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.14.2 2011-08-23 Log::Report::Exception(3pm)
All times are GMT -4. The time now is 06:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy