Hi Friends
I have the following input data in 2 columns.
SNo 1
I1 Value
I2 Value
I3 Value
SNo 2
I4 Value
I5 Value
I6 Value
I7 Value
SNo 3
I8 Value
I9 Value
...............
................
SNo N (1 Reply)
i have a file - it will be in sorted order on column 1
abc 0 1
abc 2 3
abc 3 5
def 1 7
def 0 1
--------
i'd like (awk maybe?) to get the results (any ideas)???
abc 5 9
def 1 8 (2 Replies)
Hi All,
I do have 2 files
file 1 has 4 tab delimited columns
234 a c dfgyu
294 b g fih
302 c h jzh
328 z c san
597 f g son
File 2 has 2 tab delimted columns
234 23
302 24
597 24
I want to merge file 2 with file 1 based on the data common in both files which is the first column so... (6 Replies)
I have n files (for ex:64 files) with one similar column. Is it possible to combine them all based on that column ?
file1
ax100 20 30 40
ax200 22 33 44
file2
ax100 10 20 40
ax200 12 13 44
file2
ax100 0 0 4
ax200 2 3 4 (9 Replies)
I have 100 data files labelled 250.1.txt through 250.100.txt. The second column of the data files partially match (there is about %90 overlap). Each data file has 4 columns.
I want the merge all these text files by the matching values in the second column. In the output, the first column should... (1 Reply)
Hi,
I am trying to get the common entries from 2 files based on 1st field.. However when I try to do in perl I am getting blank output.. How can I do this in awk?
open(BUFF1, "my_genes");
open(BUFF3, "rawcounts");
#open(WRBUFF,">result_rawcounts");
while($line =<BUFF1>)
{
... (3 Replies)
Hi all,
I'm trying to join two .txt file tab delimitated based on a common column.
File 1
transcript_id gene_id length effective_length expected_count TPM FPKM IsoPct
comp1000201_c0_seq1 comp1000201_c0 337 183.51 0.00 0.00 0.00 0.00
comp1000297_c0_seq1 ... (1 Reply)
Hi, I am trying to selectively merge two files based on keys reported in the 1st column.
File1:
#file1-header1
file1-header2
111 qwe rtz uio
198 asd fgh jkl
165 yxc
789 poi uzt rew
89 lkj
File2:
#file2-header2
file2-header2
165 ghz nko2 ... (2 Replies)
Hello,
I have a file with 2 columns ( tableName , ColumnName) delimited by a Pipe like below . File is sorted by ColumnName.
Table1|Column1
Table2|Column1
Table5|Column1
Table3|Column2
Table2|Column2
Table4|Column3
Table2|Column3
Table2|Column4
Table5|Column4
Table2|Column5
From... (6 Replies)
I have data of an excel files as given below,
file1
org1_1 1 1 2.5 100
org1_2 1 2 5.5 98
org1_3 1 3 7.2 88
file2
org2_1 1 1 2.5 100
org2_2 1 2 5.5 56
org2_3 1 3 7.2 70
I have multiple excel files as above shown.
I have to copy column 1, column 4 and paste into a new excel file as... (26 Replies)
Discussion started by: dineshkumarsrk
26 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)