Hi
i have a file which have a pattern like this
Nov 10 session closed
Nov 10 Nov 9 08:14:27 EST5EDT 2010 on tty .
Nov 10 Oct 19 02:14:21 EST5EDT 2010 on pts/tk .
Nov 10 afrtetryytr
Nov 10 session closed
Nov 10 Nov 10 03:21:04 EST5EDT 2010
Dec 8 Nov 10 05:03:02 EST5EDT 2010
... (13 Replies)
Hello All,
I have a file which is having below type of data,
Jul 19 2011 | 123456
Jul 19 2011 | 123456
Jul 20 2011 | 123456
Jul 20 2011 | 123456
Here I wanted to grep for date pattern as below, so that it should only grep "Jul 20" OR "Jul ... (9 Replies)
Hi
I am facing the below problem.
I have set of lines in which i have to search for only the line which matches with the pattren "/" only.
input:-
/*+ some text */
/*+ some text */
/* Remove rows from a table of survey results. */
/* Add a survey respondent's name and answers. */
/*... (7 Replies)
Let me give you a complete example what I am trying to achieve.
1. Below is the log file structure where I need 2,5 and 14th column of the logs after grepping through the linkId=1ddoic.
Log file structure:-
abc.com 20120829001415 127.0.0.1 app none11111 sas 0 0 N clk Mozilla/5.0... (3 Replies)
Hi,
I writing a shell program to remove the data from output of the find which matches a list in a file
I am using the below find command to get the list of files
x=`find . -name test*.dat`
the output of the find command is as follows
test1.dat
test2.dat
test3.dat
test4.dat... (4 Replies)
Hi,
I am trying to do pattern search using grep command. But i donot know what mistake i'm doing. I am not getting the expected Result. could any one please help me out?
$ cat b.ksh
AasdjfhB
57834B
86234B
472346B
I want to print the line which is starting with either A or 8 and... (10 Replies)
I am facing a problem while using the grep command in shell script. Actually I have one file (PCF_STARHUB_20130625_1) which contain below records.
SH_5.55916.00.00.100029_20130601_0001_NUC.csv.gz|438|3556691115
SH_5.55916.00.00.100029_20130601_0001_Summary.csv.gz|275|3919504621 ... (2 Replies)
Hi,
How can I use find command to search string/pattern in a file recursively?
What I tried:
find . -type f -exec cat {} | grep "make" \;
Output:
grep: find: ;: No such file or directory
missing argument to `-exec'
And this:
find . -type f -exec cat {} \; -exec grep "make" {} \;... (12 Replies)
One more question:
I want to grep "COS_12_TM_4 pattern from a file look likes :
"COS_12_TM_4" " ];I am taking scan_out as the input from the user.
How to search "COS_12_TM_4" in the file which is corresponds to scan_out (12 Replies)
I have this fileA
TEST FILE ABC
this file contains ABC;
TEST FILE DGHT this file contains DGHT;
TEST FILE 123
this file contains ABC,
this file contains DEF,
this file contains XYZ,
this file contains KLM
;
I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
LEARN ABOUT DEBIAN
mail::message::body::construct
Mail::Message::Body::Construct(3pm) User Contributed Perl Documentation Mail::Message::Body::Construct(3pm)NAME
Mail::Message::Body::Construct - adds functionality to Mail::Message::Body
DESCRIPTION
This package adds complex functionality to the Mail::Message::Body class. This functions less often used, so many programs will not
compile this package.
METHODS
Constructing a body
$obj->attach(MESSAGES, OPTIONS)
Make a multipart containing this body and the specified MESSAGES. The options are passed to the constructor of the multi-part body. If
you need more control, create the multi-part body yourself. At least take a look at Mail::Message::Body::Multipart.
The message-parts will be coerced into a Mail::Message::Part, so you may attach Mail::Internet or MIME::Entity objects if you want
--see Mail::Message::coerce(). A new body with attached messages is returned.
example:
my $pgpkey = Mail::Message::Body::File->new(file => 'a.pgp');
my $msg = Mail::Message->buildFromBody(
$message->decoded->attach($pgpkey));
# The last message of the $multi multiparted body becomes a coerced $entity.
my $entity = MIME::Entity->new;
my $multi = $msg->body->attach($entity);
# Now create a new message
my $msg = Mail::Message->new(head => ..., body => $multi);
$obj->concatenate(COMPONENTS)
Concatenate a list of elements into one new body.
Specify a list of text COMPONENTS. Each component can be a message (Mail::Message, the body of the message is used), a plain body
(Mail::Message::Body), "undef" (which will be skipped), a scalar (which is split into lines), or an array of scalars (each providing
one line).
example:
# all arguments are Mail::Message::Body's.
my $sum = $body->concatenate($preamble, $body, $epilogue, "--
" , $sig);
$obj->foreachLine(CODE)
Create a new body by performing an action on each of its lines. If none of the lines change, the current body will be returned,
otherwise a new body is created of the same type as the current.
The CODE refers to a subroutine which is called, where $_ contains body's original line. DO NOT CHANGE $_!!! The result of the
routine is taken as new line. When the routine returns "undef", the line will be skipped.
example:
my $content = $msg->decoded;
my $reply = $content->foreachLine( sub { '> '.$_ } );
my $rev = $content->foreachLine( sub {reverse} );
sub filled() { length $_ > 1 ? $_ : undef }
my $nonempty = $content->foreachLine( &filled );
my $wrong = $content->foreachLine( sub {s/a/A/} ); # WRONG!!!
my $right = $content->foreachLine(
sub {(my $x=$_) =~ s/a/A/; $x} );
$obj->stripSignature(OPTIONS)
Strip the signature from the body. The body must already be decoded otherwise the wrong lines may get stripped. Returned is the
stripped version body, and in list context also the signature, encapsulated in its own body object. The signature separator is the
first line of the returned signature body.
The signature is added by the sender to tell about him- or herself. It is superfluous in some situations, for instance if you want to
create a reply to the person's message you do not need to include that signature.
If the body had no signature, the original body object is returned, and "undef" for the signature body.
-Option --Default
max_lines 10
pattern qr/^--s?$/
result_type <same as current>
max_lines => INTEGER|undef
The maximum number of lines which can be the length of a signature. Specify "undef" to remove the limit.
pattern => REGEX|STRING|CODE
Which pattern defines the line which indicates the separator between the message and the signature. In case of a STRING, this is
matched to the beginning of the line, and REGEX is a full regular expression.
In case of CODE, each line (from last to front) is passed to the specified subroutine as first argument. The subroutine must return
TRUE when the separator is found.
result_type => CLASS
The type of body to be created for the stripped body (and maybe also to contain the stripped signature)
example:
my $start = $message->decoded;
my $start = $body->decoded;
my $stripped = $start->stripSignature;
my ($stripped, $sign) = $start->stripSignature
(max_lines => 5, pattern => '-*-*-');
SEE ALSO
This module is part of Mail-Box distribution version 2.105, built on May 07, 2012. Website: http://perl.overmeer.net/mailbox/
LICENSE
Copyrights 2001-2012 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 2012-05-07 Mail::Message::Body::Construct(3pm)