Sponsored Content
Top Forums Shell Programming and Scripting Help with extract particular part of data Post 302581092 by perl_beginner on Monday 12th of December 2011 04:37:41 AM
Old 12-12-2011
Help with extract particular part of data

Input file
Code:
<data>
<temporary>qe2qrqerq
qwewqeqwrqwrq
qrerwrewrwer
</temporary>
</data>
<sample>@!@##%#</sample>
<info>12345</info>
<content>2313214141454</content>
<data>
<temporary>qe2qrqerq
qrerwrewrwer
</temporary>
<content>123214214523</content>
</data>
<sample>@!@##%#</sample>
.
.

Desired output file
Code:
<data>
<temporary>qe2qrqerq
qwewqeqwrqwrq
qrerwrewrwer
</temporary>
</data>
<data>
<temporary>qe2qrqerq
qrerwrewrwer
</temporary>
<content>123214214523</content>
</data>
.
.

I would like only extract those info in between ""<data> and </data>"
Thanks for any advice.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Extract a part of file name

Hi, I want to extract a part of filename and pass it as a parameter to one of the scripts. Could someone help. File name:- NLL_NAM_XXXXX.XXXXXXX_1_1.txt. Here i have to extract only XXXXX.XXXXXXX and the position will be constant. that means that i have to extract some n characters from... (6 Replies)
Discussion started by: dnat
6 Replies

2. Shell Programming and Scripting

Extract data based on match against one column data from a long list data

My input file: data_5 Ali 422 2.00E-45 102/253 140/253 24 data_3 Abu 202 60.00E-45 12/23 140/23 28 data_1 Ahmad 256 7.00E-45 120/235 140/235 22 data_4 Aman 365 8.00E-45 15/65 140/65 20 data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies

3. Shell Programming and Scripting

Extract specific data content from a long list of data

My input: Data name: ABC001 Data length: 1000 Detail info Data Direction Start_time End_time Length 1 forward 10 100 90 1 forward 15 200 185 2 reverse 50 500 450 Data name: XFG110 Data length: 100 Detail info Data Direction Start_time End_time Length 1 forward 50 100 50 ... (11 Replies)
Discussion started by: patrick87
11 Replies

4. UNIX for Dummies Questions & Answers

How to get data only inside polygon created by points which is part of whole data from file?

hiii, Help me out..i have a huge set of data stored in a file.This file has has 2 columns which is latitude & longitude of a region. Now i have a program which asks for the number of points & based on this number it asks the user to enter that latitude & longitude values which are in the same... (7 Replies)
Discussion started by: reva
7 Replies

5. Shell Programming and Scripting

extract last part of string.

Hi, I have a string like this BUNDLE=/home/bob/flx/user.bun how to extract only the the last part ie, only user.bun (2 Replies)
Discussion started by: vprasads
2 Replies

6. Shell Programming and Scripting

How to extract one part from whole output

Hi All, I am trying to write a small shell programming to get db2 database size info. The command I am going to use is- db2 "CALL GET_DBSIZE_INFO(?, ?, ?, -1)" and the output of above command generally is- Value of output parameters -------------------------- Parameter Name :... (4 Replies)
Discussion started by: NARESH1302
4 Replies

7. Shell Programming and Scripting

how to extract a certain part of a line

Hi friends, I want to select and use the certain part of a line. For example I have the following line home/1245/hgdf/acsdf/myhome/afolder/H2O/endfile how can I extract the part " /myhome/afolder/H2O/endfile " thanks (6 Replies)
Discussion started by: rpf
6 Replies

8. Shell Programming and Scripting

Extract part of a string

I have a file with 100s of lines of text. I want to perform an extraction of this line: Info bpzs(pid=2652) using 1000 bits I have not been able to extract it. Should I try expr match or is there another method? This line has data both in front of and in back of it. I do not have grep -o... (5 Replies)
Discussion started by: newbie2010
5 Replies

9. Shell Programming and Scripting

Extract part of file

Hello All, I need to extract part of a file into a new file My file is Define schema xxxxxx Insert into table ( a ,b ,c ,d ) values ( 1, 2, 3, (15 Replies)
Discussion started by: nnani
15 Replies

10. UNIX for Advanced & Expert Users

Need help to extract part of the string

Hi, I have a string with name as 20140412-s1-Potopolive_promos_20140412. So I want to extract only Potopolive string. Could you please help me the command. O/p : Potopolive Thx in advance (5 Replies)
Discussion started by: lkeswar
5 Replies
Aspect::Advice::Around(3pm)				User Contributed Perl Documentation			       Aspect::Advice::Around(3pm)

NAME
Aspect::Advice::Around - Execute code both before and after a function SYNOPSIS
use Aspect; around { # Trace all calls to your module print STDERR "Called my function " . $_->sub_name . " "; # Lexically alter a global for this function local $MyModule::MAXSIZE = 1000; # Continue and execute the function $_->run_original; # Suppress exceptions for the call $_->return_value(1) if $_->exception; } call qr/^ MyModule::w+ $/; DESCRIPTION
The "around" advice type is used to execute code on either side of a function, allowing deep and precise control of how the function will be called when none of the other advice types are good enough. Using "around" advice is also critical if you want to lexically alter the environment in which the call will be made (as in the example above where a global variable is temporarily changed). This advice type is also the most computationally expensive to run, so if your problem can be solved with the use of a different advice type, particularly "before", you should use that instead. Please note that unlike the other advice types, your code in "around" is required to trigger the execution of the target function yourself with the "proceed" method. If you do not "proceed" and also do not set either a "return_value" or "exception", the function call will return "undef" in scalar context or the null list "()" in list context. AUTHORS
Adam Kennedy <adamk@cpan.org> COPYRIGHT AND LICENSE
Copyright 2010 Adam Kennedy. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-02-01 Aspect::Advice::Around(3pm)
All times are GMT -4. The time now is 05:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy