I have a data file that is arranged like this:
Marketing Ranjit Singh Eagles Dean Johnson FULL
Marketing Ken Whillans Eagles Karen Thompson FULL
Sales Peter RobertsonGolden TigersRich Gardener PART
President Sandeep Jain Wimps Ken Whillans CONT... (7 Replies)
hi everyone,
I am looking for an easy way to extract columns from a text file based on a regular expression, kind of like grep but searching and returning columns instead.
for example, suppose i have the following file, 'file.txt':
A B C D B
1 2 3 4 5
6 7 8 9 0
5 6 7 8 9
2 3 8 9 0
I... (6 Replies)
Hi,
I need to perform a grep from a file, but ignore any results from the first column.
For simplicity I have changed the actual data, but for arguments sake, I have a file that reads:
MONACO Monaco ASMonaco
MANUTD ManUtd ManchesterUnited
NEWCAS NewcastleUnited
NAC000 NAC ... (5 Replies)
Hi have a large spreadsheet which has 4 columns
APM00111803814 server_2 96085 Corp IT Desktop and Apps
APM00111803814 server_2 96085 Corp IT Desktop and Apps
APM00111803814 server_2 96034 Storage Mgmt Team
APM00111803814 server_2 96152 GWP... (6 Replies)
Trying to do a grep -v on a value in the 2nd column of text. So if the word apple appears in a line in the 2nd column, it would not show up when the file was cat. Seems like a simple enough operation but I just can't figure it out. Any help would be appreciated. Thanks in advance.
Are apples... (4 Replies)
PROL\tests_li004_developers:VAS:3543346:q34243,d3hs35,34bdf3,24sfgg,a3s234
Im trying to grep all text after VAS:3543346, so im trying to just have this
q34243,d3hs35,34bdf3,24sfgg,a3s234
Im confused on how I would do this (7 Replies)
Hello All
I have an input file with data below. I would like to grep and display the data where 3rd column contains string or at least one character. Kindly please help me with this!
Input:
tjfa3|zznpou|224fdd.34.ff3.35 |Tiv|Otj|1
fgduul7|zznikj| ... (7 Replies)
I have a file with two columns separated by white space.
Dog Cat
fido sneaky
dopey poptart
ears whisker
barky herd
Trying to list the words under the column named Dog. Tried a few variations of awk but can't... (4 Replies)
Gents
Is it possible to update the code to get the desired output files from the input list. I called variable to the first column.
I need to consider the first column as key to grep the values in the second column according to the desired request.
input list
(attached )
output1
... (12 Replies)
Discussion started by: jiam912
12 Replies
LEARN ABOUT DEBIAN
mime::explode
Explode(3pm) User Contributed Perl Documentation Explode(3pm)NAME
MIME::Explode - Perl extension for explode MIME messages
SYNOPSIS
use MIME::Explode;
my $explode = MIME::Explode->new(
output_dir => "tmp",
mkdir => 0755,
decode_subject => 1,
check_content_type => 1,
content_types => ["image/gif", "image/jpeg", "image/bmp"],
types_action => "exclude"
);
print "Number of messages: ", $explode->nmsgs, "
";
open(MAIL, "<file.mbox") or
die("Couldn't open file.mbox for reading: $!
");
open(OUTPUT, ">file.tmp")
or die("Couldn't open file.tmp for writing: $!
");
my $headers = $explode->parse(*MAIL, *OUTPUT);
close(OUTPUT);
close(MAIL);
for my $part (sort{ $a cmp $b } keys(%{$headers})) {
for my $k (keys(%{$headers->{$part}})) {
if(ref($headers->{$part}->{$k}) eq "ARRAY") {
for my $i (0 .. $#{$headers->{$part}->{$k}}) {
print "$part => $k => $i => ", $headers->{$part}->{$k}->[$i], "
";
}
} elsif(ref($headers->{$part}->{$k}) eq "HASH") {
for my $ks (keys(%{$headers->{$part}->{$k}})) {
if(ref($headers->{$part}->{$k}->{$ks}) eq "ARRAY") {
print "$part => $k => $ks => ", join(($ks eq "charset") ? " " : "", @{$headers->{$part}->{$k}->{$ks}}), "
";
} else {
print "$part => $k => $ks => ", $headers->{$part}->{$k}->{$ks}, "
";
}
print "$part => $k => $ks => ", $headers->{$part}->{$k}->{$ks}, "
";
}
} else {
print "$part => $k => ", $headers->{$part}->{$k}, "
";
}
}
}
if(my $e = $explode->clean_all()) {
print "Error: $e
";
}
DESCRIPTION
MIME::Explode is perl module for parsing and decoding single or multipart MIME messages, and outputting its decoded components to a given
directory ie, this module is designed to allows users to extract the attached files out of a MIME encoded email messages or mailboxes.
METHODS
new([, OPTION ...])
This method create a new MIME::Explode object. The following keys are available:
output_dir
Directory where the decoded files are placed
mkdir => octal_number
If the value is set to octal number then make the output_dir directory (example: mkdir => 0755).
check_content_type => 0 or 1
If the value is set to 1 the content-type of file is checked
decode_subject => 0 or 1
If the value is set to 1 then the subject is decoded into a list.
$header->{'0.0'}->{subject}->{value} = [ARRAYREF];
$header->{'0.0'}->{subject}->{charset} = [ARRAYREF];
$subject = join("", @{$header->{'0.0'}->{subject}->{value}});
exclude_types => [ARRAYREF]
Not save files with specified content types (deprecated in next versions)
content_types => [ARRAYREF]
Array reference with content types for "include" or "exclude"
types_action => "include" or "exclude"
If the action is a "include", all attached files with specified content types are saved but if the action is a "exclude", no files
are saved except if its in the array of content types. If no array is specified, but the action is a "include", all attached files
are saved, otherwise all files are removed if action is a "exclude". The default action is "include".
parse(FILEHANDLE, FILEHANDLE)
This method parse the stream and splits it into its component entities. This method return a hash reference with all parts. The FILEHANDLE
should be a reference to a GLOB. The second argument is optional.
nmsgs
Returns the number of parsed messages.
clean_all
Cleans all files from the "output_dir" directory and then removes the directory. If an error happens returns it.
AUTHOR
Henrique Dias <henrique.ribeiro.dias@gmail.com>
CREDITS
Thanks to Rui Castro for the revision.
SEE ALSO
MIME::Tools, perl(1).
perl v5.14.2 2011-06-26 Explode(3pm)