suppose u hava a file
G1354R tGGC-CGC
D1361N cGAC-AAC
I1424T ATC-ACC
R768W gCGG-TGG
Q1382R CAG-CGG
Q178E gCAG-GAG
Y181C TAC-TGC
.........cont.
So the question is
By searching for first word i.e.character say R
output shud be
R768W gCGG-TGG
R182P CGG-CCG
R189W ... (6 Replies)
File1 row is same as column 2 in file 2.
Also file 2 will either start with A, B or C.
And 3rd column in file 2 is always F2.
When column 2 of file 2 matches file1 column, print all those rows into a separate file.
Here is an example.
file 1:
100
103
104
108
file 2:
... (6 Replies)
Hi ,
I am trying to extract contents of a file between specified time stamp. but it does not seem to work. i am trying to extract output of /var/adm/messages between 15:00:00 to 15:23:59 .
i have tried two regex the first one seems to kind of work. it displays some output. the second one is... (13 Replies)
A question to the awk pundits:
I was thinking about composing a regex in a variable and then use its contents like $0 ~ var instead of $0 ~ /r/. Sort of indirection. Did someone run into this? Is it possible at all? (3 Replies)
I have a file of protein sequences with headers (my source file). Based on a list of IDs (which are included in some of the headers), I'd like to print out only the specified sequences, with only the ID as header.
In other words, I'd like to search source.txt for the terms in IDs.txt, and print... (3 Replies)
Hi,
I am using the following code to fetch lines that are generated in last 1 hr . Hence, I am using date function to calculate -last 1 hr & the current hr and then somehow use awk (or sed-if someone could guide me better)
with some regex pattern.
dt_1=`date +%h" "%d", "%Y\ %l -d "1 hour... (10 Replies)
Hello,
I have a set of files Xfile0001 - Xfile0021, and the content of this files (one at a time) needs to be printed between some line (lines start with word "Generated") that I am extracting from another file called file7.txt and all the output goes into output.txt. First I tried creating a for... (5 Replies)
grep -v will exclude matching lines, but I want something that will print all lines but exclude a matching field. The pattern that I want excluded is '/mnt/svn'
If there is a better solution than awk I am happy to hear about it, but I would like to see this done in awk as well. I know I can... (11 Replies)
Hello.
I have been looking high and low for the solution for this. I seems there should be a simple answer, but alas.
I have a big xml file, and I need to extract certain information from specific items. The information I need can be found between a specific set of tags. let's call them... (2 Replies)
Discussion started by: Tobias-Reiper
2 Replies
LEARN ABOUT DEBIAN
email::foldertype
Email::FolderType(3pm) User Contributed Perl Documentation Email::FolderType(3pm)NAME
Email::FolderType - determine the type of a mail folder
SYNOPSIS
use Email::FolderType qw(folder_type);
print folder_type "~/mymbox"; # prints 'Mbox'
print folder_type "~/a_maildir/"; # prints 'Maildir'
print folder_type "some_mh/."; # prints 'MH'
print folder_type "an_archive//"; # prints 'Ezmlm'
DESCRIPTION
Provides a utility subroutine for detecting the type of a given mail folder.
SUBROUTINES
folder_type <path>
Automatically detects what type of mail folder the path refers to and returns the name of that type.
It primarily bases the type on the suffix of the path given.
Suffix | Type
--------+---------
/ | Maildir
/. | MH
// | Ezmlm
In case of no known suffix it checks for a known file structure. If that doesn't work out it defaults to "Mbox" although, if the "Mbox"
matcher has been overridden or the default changed (see DEFAULT MATCHER below) then it will return undef.
matchers
Returns a list of all the matchers available to the system.
DEFAULT MATCHER
Currently the default matcher is "Mbox" and therefore it is always checked last and always returns 1.
If you really want to change this then you should override "Email::FolderType::Mbox::match" and/or change the variable $Email::Folder-
Type::DEFAULT to be something other than 'Mbox'.
use Email::FolderType;
use Email::FolderType::Mbox;
$Email::FolderType::DEFAULT = 'NewDefault';
package Email::FolderType::Mbox;
sub match { return (defined $_[0] && -f $_[0]) }
package Email::FolderType::NewDefault;
sub match { return (defined $_[0] && $_[0] =~ m!some crazy pattern!) }
1;
REGISTERING NEW TYPES
"Email::FolderType" briefly flirted with a rather clunky "register_type" method for registering new matchers but, in retrospect that wasn't
a great idea.
Instead, in this version we've reverted to a "Module::Pluggable" based system - any classes in the "Email::FolderType::" namespace will be
interrogated to see if they have a c<match> method.
If they do then it will be passed the folder name. If the folder matches then the match function should return 1. For example ...
package Email::FolderType::GzippedMbox;
sub match {
my $folder = shift;
return (-f $folder && $folder =~ /.gz$/);
}
1;
These can even be defined inline ...
#!perl -w
use strict;
use Email::Folder;
use Email::LocalDelivery;
# copy all mail from an IMAP folder
my $folder = Email::Folder->new('imap://example.com'); # read INBOX
for ($folder->messages) {
Email::LocalDelivery->deliver($_->as_string, 'local_mbox');
}
package Email::FolderType::IMAP;
sub match {
my $folder = shift;
return $folder =~ m!^imap://!;
}
1;
If there is demand for a compatability shim for the old "register_type" method then we can implement one. Really though, this is much bet-
ter in the long run.
PERL EMAIL PROJECT
This module is maintained by the Perl Email Project.
http://emailproject.perl.org/wiki/Email::FolderType
AUTHOR
Simon Wistow <simon@thegestalt.org>
COPYING
(C) Copyright 2005, Simon Wistow
Distributed under the same terms as Perl itself.
This software is under no warranty and will probably ruin your life, kill your friends, burn your house and bring about the apocalypse.
SEE ALSO
Email::LocalDelivery, Email::Folder
perl v5.8.8 2006-08-22 Email::FolderType(3pm)