Sponsored Content
Full Discussion: Capturing Particular Data
Top Forums Shell Programming and Scripting Capturing Particular Data Post 302299752 by ldapswandog on Saturday 21st of March 2009 07:08:33 AM
Old 03-21-2009
Sorry about that you need to add an '=' sign to each of the wildcard searches so it consistently captures lines with 2 or more in a row.
Code:
sed -n -e '/^==*Date: 2009-03-18/,/^==*/s/^.* Prompt: //p' inputFile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

capturing process id

I am newbie to unix shells world. I am trying to capture a background process id into a file so that it can be killed later. this process is basically a java program running in background as: java TestApp & this returning process id immediately. So how can i redirect that pid into a file.... (1 Reply)
Discussion started by: bvreddy
1 Replies

2. UNIX for Dummies Questions & Answers

Capturing some data from a file into a variable

I have a file with some values in a tab delimted format Eg: 'test' contains: a<tab>b<tab>c<tab>Trk_12345678 now i need to capture this value 'Trk_12345678' into a variable say 'x' and append that value of 12345678 to 12345679 and store is back to a new 'test1' file as : 'test1'... (11 Replies)
Discussion started by: shiroh_1982
11 Replies

3. Shell Programming and Scripting

Capturing Unix Traceroute data

Hi guys, I need a way to capture the host on the next-to-last hop in a traceroute output. The last output is the destination but I need to capture the router just before the last hop. I can do this in perl but I'm not so sure about Shell... I'm on AIX 5.3 using ksh any ideas? ... (3 Replies)
Discussion started by: TivoliGUY
3 Replies

4. Shell Programming and Scripting

Capturing Data between first quote and next quote

I have input file like RDBMS FALIURE UTY8703 'USER_WORK.TEST' .HIghest return code '12' I want to parse data which comed between first quote till next quote USER_WORK.TEST can you please suggest how to do that (4 Replies)
Discussion started by: scorp_rahul23
4 Replies

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

6. Shell Programming and Scripting

Capturing data between patterns

Hii, Friends, I want your help in one of my problem. My problem is as follows. I have a flat file as follows (Just a sample) MHT011 01(DOT)8750707asdfas8609 03(DOT)ASD3453ASD 09(DOT)876JHT87 11(DOT)sfd324ert TTT077 01(MOB)876786klj897 06(MOB)876JHT87 07(MOB)sfd324ert... (4 Replies)
Discussion started by: anushree.a
4 Replies

7. IP Networking

How to capturing packet data so i can see the Version, IHL, TOS, etc?

Helo Folks :) i had read an answer in this thread unixcom/programming/117551-calculate-ip-header-checksum-manually.html i need to know what the software name that was used to capturing packet data in a network, just like the packet's capture output that showed up in the thread. Thank you :)... (5 Replies)
Discussion started by: polutan
5 Replies

8. Red Hat

capturing data of nethogs

I have installed nethogs to see which process is sending load on the network. i would like to know how can i capture its data in a log file. Or is there is a unix command like script or tee which can help me to capture the data using cronjob (0 Replies)
Discussion started by: anshus1
0 Replies

9. Shell Programming and Scripting

capturing selective data from a vcd file

Hi, This is a vcd file.A vcd file may have 'n' modules. 1) I need to capture the data in bold,i.e. the module names (shown in bold) 2) Also i need to capture the data inside each individual module,say for tst_bench_top ,i need to capture data from line 4 to line 20 ... I just want one... (2 Replies)
Discussion started by: veerabahu
2 Replies

10. Shell Programming and Scripting

Perl : not capturing all the data from excel sheet

Hi folks, I am working on assignment that captures all the records(2 columns one column contains names and other contain date of birth) from excel sheet stored in a directory and checks for current date and month. If it matches current date and month then the matched records are printed as... (1 Reply)
Discussion started by: giridhar276
1 Replies
Sub::Quote(3)						User Contributed Perl Documentation					     Sub::Quote(3)

NAME
Sub::Quote - efficient generation of subroutines via string eval SYNOPSIS
package Silly; use Sub::Quote qw(quote_sub unquote_sub quoted_from_sub); quote_sub 'Silly::kitty', q{ print "meow" }; quote_sub 'Silly::doggy', q{ print "woof" }; my $sound = 0; quote_sub 'Silly::dagron', q{ print ++$sound % 2 ? 'burninate' : 'roar' }, { '$sound' => $sound }; And elsewhere: Silly->kitty; # meow Silly->doggy; # woof Silly->dagron; # burninate Silly->dagron; # roar Silly->dagron; # burninate DESCRIPTION
This package provides performant ways to generate subroutines from strings. SUBROUTINES
quote_sub my $coderef = quote_sub 'Foo::bar', q{ print $x++ . " " }, { '$x' => }; Arguments: ?$name, $code, ?\%captures, ?\%options $name is the subroutine where the coderef will be installed. $code is a string that will be turned into code. "\%captures" is a hashref of variables that will be made available to the code. The keys should be the full name of the variable to be made available, including the sigil. The values should be references to the values. The variables will contain copies of the values. See the "SYNOPSIS"'s "Silly::dagron" for an example using captures. options o no_install Boolean. Set this option to not install the generated coderef into the passed subroutine name on undefer. unquote_sub my $coderef = unquote_sub $sub; Forcibly replace subroutine with actual code. If $sub is not a quoted sub, this is a no-op. quoted_from_sub my $data = quoted_from_sub $sub; my ($name, $code, $captures, $compiled_sub) = @$data; Returns original arguments to quote_sub, plus the compiled version if this sub has already been unquoted. Note that $sub can be either the original quoted version or the compiled version for convenience. inlinify my $prelude = capture_unroll '$captures', { '$x' => 1, '$y' => 2, }; my $inlined_code = inlinify q{ my ($x, $y) = @_; print $x + $y . " "; }, '$x, $y', $prelude; Takes a string of code, a string of arguments, a string of code which acts as a "prelude", and a Boolean representing whether or not to localize the arguments. capture_unroll my $prelude = capture_unroll '$captures', { '$x' => 1, '$y' => 2, }, 4; Arguments: $from, \%captures, $indent Generates a snippet of code which is suitable to be used as a prelude for "inlinify". $from is a string will be used as a hashref in the resulting code. The keys of %captures are the names of the variables and the values are ignored. $indent is the number of spaces to indent the result by. CAVEATS
Much of this is just string-based code-generation, and as a result, a few caveats apply. return Calling "return" from a quote_sub'ed sub will not likely do what you intend. Instead of returning from the code you defined in "quote_sub", it will return from the overall function it is composited into. So when you pass in: quote_sub q{ return 1 if $condition; $morecode } It might turn up in the intended context as follows: sub foo { <important code a> do { return 1 if $condition; $morecode }; <important code b> } Which will obviously return from foo, when all you meant to do was return from the code context in quote_sub and proceed with running important code b. pragmas "Sub::Quote" preserves the environment of the code creating the quoted subs. This includes the package, strict, warnings, and any other lexical pragmas. This is done by prefixing the code with a block that sets up a matching environment. When inlining "Sub::Quote" subs, care should be taken that user pragmas won't effect the rest of the code. SUPPORT
See Moo for support and contact information. AUTHORS
See Moo for authors. COPYRIGHT AND LICENSE
See Moo for the copyright and license. perl v5.18.2 2013-12-31 Sub::Quote(3)
All times are GMT -4. The time now is 10:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy