Could you please try following and let me know if this helps.
i- If your complete data is as same as you have shown, means each line has it's same LINE with line number and not more thn 4 fields in Input_file then following may help.
2nd: If you may have different data like different LINE numbers. number of columns(But considering that columns which have LINE string willhave only 2 columns serated by /) may vary than following may help you in same.
Output will be as follows in both above conditions.
Thanks,
R. Singh
Last edited by RavinderSingh13; 01-14-2016 at 11:41 PM..
Reason: Added a comment now to solution.
This User Gave Thanks to RavinderSingh13 For This Post:
Hello,
I have a log file which is generated by a script which looks like this:
userid: 7
starttime: Sat May 24 23:24:13 CEST 2008
endtime: Sat May 24 23:26:57 CEST 2008
total time spent: 2.73072 minutes / 163.843 seconds
date: Sat Jun 7 16:09:03 CEST 2008
userid: 8
starttime: Sun May... (7 Replies)
Hi
I have been struggling with a script for removing duplicate messages from a shared mailbox.
I would like to search for duplicate messages based on the “Message-ID” string within the messages files.
I have managed to find the duplicate “Message-ID” strings and (if I would like) delete... (1 Reply)
I need to count the number of occurrences of a pattern, say 'key', between each occurrence of a different pattern, say 'lu'.
Here's a portion of the text I'm trying to parse:
lu S1234L_149_m1_vg.6, part-att 1, vdp-att 1 p-reserver IID 0xdb
registrations:
key 4156 4353 0000 0000
... (3 Replies)
i have nasty html file with 2000+ simbols in 1 row...i need to remove whole the code except title="Some title..." and store those into file with titles (the whole text is in variable text)
i've tried something like this:
echo $text | sed 's/.*\(title=\".+\"\).*/\1/' > titles.html
BUT it does... (13 Replies)
Hello,
Although I have found similar questions, I could not find advice that
could help with our problem.
The issue:
We have several hundreds text files containing repeated blocks of text
(I guess back at the time they were prepared like that to optmize
printing).
The block of texts... (13 Replies)
So, I have text files,
one "fail.txt"
And one
"color.txt"
I now want to use a command line (DOS) to remove ANY line that is PRESENT IN BOTH from each text file.
Afterwards there shall be no duplicate lines. (1 Reply)
Hi All
I have a list of files which will have duplicate list of blocks of text. Following is a sample of the file, I have removed the sensitive information from the file.
All the code samples starts from <TR BGCOLOR="white"> and Ends with IP address and two html tags like this.
10.14.22.22... (3 Replies)
Hi , We need to remove comment like pattern from a code text. The possible comment expressions are as follows.
Input
BizComment : Special/*@
Name:bzt_53_3aea640a_51783afa_5d64_0
BizHidden:true
@*/
/* lookup Disease
Category Therapuetic Class */
a=b;... (6 Replies)
Discussion started by: VikashKumar
6 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)