Hi All,
I have almost 1000+ files and I want to search specific pattern. Looking forwarded your input.
Search for: word1.word2 (Which procedure contain this word, I need procedure name in output.
Expected output:
procedure test1
procedure test2
procedure test3
procedure test4
... (7 Replies)
Hi,
I have a text file similar to the example below and I want to print the second line every time after the "--------------------------" pattern is found. The pattern is a fixed length of - characters.
Example of input;
1 --------------------------
2
3 39184018234
4 ... (10 Replies)
i have a file like below. how can i printout the digits followed by the pattern -bwout and -bwin. say i run the script by entering line number 145 (the fourth line), then the o/p should be like
5000000 1024000
8 test1 -ipprot erp -ppsout 500 -ppsin 500 -bwout 300000 -bwin 300000 -statsdevice... (7 Replies)
i have a file which contains alphanumeric data in every line. what i need is the data after certain pattern. the data after the pattern is not of fixed length so i need the data till the space after the pattern.
Input file:
bfdkasfbdfg khffkf lkdhfhdf pattern (datarequired data not required)... (2 Replies)
Is there a way with aw to print all lines after a string is found
There is a file like this
.......
........
2012/19/11 :11.58 PM some data
lne no date
2012/19/11 :11.59 PM some other data
2012/20/11 :12.00 AM some other data
some line without dates
some more lines without dates... (8 Replies)
Hi,
I have a folder with multiple (< 33) .log files.
And I have to copy the lines between two patterns from all the .log files to a new file.
(script file with a loop?)
Thanks in advance.
1.log
...
..
xx1> begin
...
..
..
>>> Total: 2 Alarms
..
.. (17 Replies)
Hi Gurus, i need your help to create a script the will print a characters after the pattern was found.
Sample lines are below:
My birthday:"1977-16-07", My birthday:"1975-16-07"
My birthday:"1970-16-07".
My patter should be "birthday:", then i want to print the following characters which... (18 Replies)
Hi,
here are few lines present in the logs. I want to grep on Error and print few lines before and after Error word is found
line1
Line2
Line3
Error
Line4
Line5
Line6
Line7
I want the output to be
Line2
Line3
Error
Line5 (1 Reply)
Hello Forum Members,
I am trying to write a script for a requirement where i have to recursively search for a pattern and replace it with the new string in run time from user inputs
grep -ohr "]*.xyz.com]*" $HOME/source/group/ | sort | uniq > $HOME/output.txt
while read -r -u9 line;
... (4 Replies)
Discussion started by: raokl
4 Replies
LEARN ABOUT MOJAVE
regexp::common::list
Regexp::Common::list(3) User Contributed Perl Documentation Regexp::Common::list(3)NAME
Regexp::Common::list -- provide regexes for lists
SYNOPSIS
use Regexp::Common qw /list/;
while (<>) {
/$RE{list}{-pat => 'w+'}/ and print "List of words";
/$RE{list}{-pat => $RE{num}{real}}/ and print "List of numbers";
}
DESCRIPTION
Please consult the manual of Regexp::Common for a general description of the works of this interface.
Do not use this module directly, but load it via Regexp::Common.
$RE{list}{-pat}{-sep}{-lastsep}
Returns a pattern matching a list of (at least two) substrings.
If "-pat=P" is specified, it defines the pattern for each substring in the list. By default, P is "qr/.*?S/". In Regexp::Common 0.02 or
earlier, the default pattern was "qr/.*?/". But that will match a single space, causing unintended parsing of "a, b, and c" as a list of
four elements instead of 3 (with "-word" being "(?:and)"). One consequence is that a list of the form "a,,b" will no longer be parsed. Use
the pattern "qr /.*?/" to be able to parse this, but see the previous remark.
If "-sep=P" is specified, it defines the pattern P to be used as a separator between each pair of substrings in the list, except the final
two. By default P is "qr/s*,s*/".
If "-lastsep=P" is specified, it defines the pattern P to be used as a separator between the final two substrings in the list. By default
P is the same as the pattern specified by the "-sep" flag.
For example:
$RE{list}{-pat=>'w+'} # match a list of word chars
$RE{list}{-pat=>$RE{num}{real}} # match a list of numbers
$RE{list}{-sep=>" "} # match a tab-separated list
$RE{list}{-lastsep=>',s+ands+'} # match a proper English list
Under "-keep":
$1 captures the entire list
$2 captures the last separator
$RE{list}{conj}{-word=PATTERN}
An alias for $RE{list}{-lastsep=>'s*,?s*PATTERNs*'}
If "-word" is not specified, the default pattern is "qr/and|or/".
For example:
$RE{list}{conj}{-word=>'et'} # match Jean, Paul, et Satre
$RE{list}{conj}{-word=>'oder'} # match Bonn, Koln oder Hamburg
$RE{list}{and}
An alias for $RE{list}{conj}{-word=>'and'}
$RE{list}{or}
An alias for $RE{list}{conj}{-word=>'or'}
SEE ALSO
Regexp::Common for a general description of how to use this interface.
AUTHOR
Damian Conway (damian@conway.org)
MAINTAINANCE
This package is maintained by Abigail (regexp-common@abigail.be).
BUGS AND IRRITATIONS
Bound to be plenty.
For a start, there are many common regexes missing. Send them in to regexp-common@abigail.be.
LICENSE and COPYRIGHT
This software is Copyright (c) 2001 - 2009, Damian Conway and Abigail.
This module is free software, and maybe used under any of the following licenses:
1) The Perl Artistic License. See the file COPYRIGHT.AL.
2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2.
3) The BSD Licence. See the file COPYRIGHT.BSD.
4) The MIT Licence. See the file COPYRIGHT.MIT.
perl v5.18.2 2013-03-08 Regexp::Common::list(3)