A grep-like code from ATT, cgrep, allows 3 patterns: the pattern in which you are primarily interested, and the 2 end-point patterns of an enclosing window. Here is an example:
producing:
You will need to compile cgrep. I have done it several times in both 32-bit and 64-bit without trouble.
Hi ,
Unix.com has been life saver for me I admit :)
I am trying to extract a paragraph based on matching pattern "CREATE TABLE " from a ddl file . The paragraphs are seperated by blank line .
Input file is
#cat zip.20080604.sql1
CONNECT TO TST103
SET SESSION_USER OPSDM002
... (2 Replies)
Hi, guys. I have one question:
I need to search for a string in a file, and then extract another string from the file and assign it to a variable.
For example:
the contents of the file (group) is below:
...
ftp:x:23:
mail:x:34
...
testing:x:2001
sales:x:2002
development:x:2003
...... (6 Replies)
Hi all,
i'm new to this community. I am trying to write a script which will fetch ftp completion time of a file from a paragraph of a big text file ( which contains multiple paragraphs) . Each paragraph will have ftp details..
Now I dont know how to fetch process time within a paragraph of... (3 Replies)
Hi, I'm trying to output all text from the first paragraph in a file that contains a specific string through the last paragraph in that file that contains that string.
Previously, I was outputting just each paragraph with that search string with:
cat in_file | nawk '{RS=""; FS="\n";... (2 Replies)
Hi all,
The following lines are taken from a long paragraph:
Labels of output orbitals: RY* RY* RY* RY* RY* RY*
1\1\GINC-COMPUTE-1-3\SP\UB3LYP\6-31G\C2H5Cr1O1(1+,5)\LIUZHEN\19-Jan-20
10\0\\# ub3lyp/6-31G pop=(nbo,savenbo) gfprint\\E101GECP\\1,5\O,0,-1.7
... (1 Reply)
continuing from my previous post, whose link is given below as a reference
https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569
consider there is create table commands in a file for eg:
CREATE TABLE `Blahblahblah` (
`id` int(11) NOT NULL... (2 Replies)
Need Assistance in shell programming... I have a huge file which has multiple stations and i wanted to search particular station and extract few lines from it and the rest is not needed
Bold letters are the stations . The whole file has multiple stations .
Below example i wanted to search... (4 Replies)
Hello guys,
I have problem with hpux shell script. I have one big text file that contains like
SOH
bla bla bla
bla bla bla
ETX SOH
bla bla bla
ETX
SOH
bla bla bla
ETX
What I need to do is save first SOH*BLA into file1.txt, save second SOH*BLA into file2.txt and so on.... (17 Replies)
I am using OSX. I have a multi-mol2 file (text file with coordinates and info for several molecules). An example of two molecules in the file is given below for molecule1 and molecule 2. The total file contains >50,000 molecules.
I would like to extract out and write to another file only the... (2 Replies)
Hi,
Its been a long time since I have used Bash to write a script so am really struggling here. Need the gurus to help me out.
uname -a
Linux lxserv01 2.6.18-417.el5
i have a text file with blocks of code written in a similar manner
******* BEGIN MESSAGE *******
Station /... (12 Replies)
Discussion started by: dsid
12 Replies
LEARN ABOUT DEBIAN
pod::elemental::selectors
Pod::Elemental::Selectors(3pm) User Contributed Perl Documentation Pod::Elemental::Selectors(3pm)NAME
Pod::Elemental::Selectors - predicates for selecting elements
VERSION
version 0.102362
OVERVIEW
Pod::Elemental::Selectors provides a number of routines to check for Pod::Elemental paragraphs with given qualities.
SELECTORS
Selectors are predicates: they examine paragraphs and return either true or false. All the selectors have (by default) names like:
"s_whatever". They expect zero or more parameters to affect the selection. If these parameters are given, but no paragraph, a callback
will be returned that will expect a paragraph. If a paragraph is given, the selector will return immediately.
For example, the "s_command" selector expects a parameter that can be the name of the command desired. Both of the following uses are
valid:
# create and use a callback:
my $selector = s_command('head1');
my @headers = grep { $selector->($_) } @paragraphs;
# just check a paragraph right now:
if ( s_command('head1', $paragraph) ) { ... }
The selectors can be imported individually or as the "-all" group, and can be renamed with Sub::Exporter features. (Selectors cannot yet
be curried by Sub::Exporter.)
s_blank
my $callback = s_blank;
if( s_blank($para) ) { ... }
"s_blank" tests whether a paragraph is a Generic::Blank element.
s_flat
my $callback = s_flat;
if( s_flat($para) ) { ... }
"s_flat" tests whether a paragraph does Pod::Elemental::Flat -- in other words, is content-only.
s_node
my $callback = s_node;
if( s_node($para) ) { ... }
"s_node" tests whether a paragraph does Pod::Elemental::Node -- in other words, whether it may have children.
s_command
my $callback = s_command;
my $callback = s_command( $command_name);
my $callback = s_command(@command_names);
if( s_command(undef, $para) ) { ... }
if( s_command( $command_name, $para) ) { ... }
if( s_command(@command_names, $para) ) { ... }
"s_command" tests whether a paragraph does Pod::Elemental::Command. If a command name (or a reference to an array of command names) is
given, the tested paragraph's command must match one of the given command names.
AUTHOR
Ricardo SIGNES <rjbs@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-05-05 Pod::Elemental::Selectors(3pm)