Andrej Kastrin [AK], on Monday, December 19, 2005 at 13:13 (+0100)
thinks about:

AK> So, following code split each line and print it.
AK> while (<>){
AK>     @column = split(/\t/,$_);  # split current line, field separator set
AK> to tab
AK>     print OUTPUT "$column[0]\t$column[1]\tt$column[2]\n";

if you can write this code, I'm sure, you can write the same, with "|"
as delimiter.
But here is example:

use strict;
use warnings;

$|++;
$, = "\t";

while (<DATA>){
    chomp;
    next unless $_;
    my @column = split /\t/;
    print "$column[0]\t$column[1]" , split(/\|/, $column[2]) , "\n";
}
 
__DATA__
00001   BRCA3   BRCA33|BRCA55   symbol 998
00002   ABCB1   DASH|BASG|AVGA4 symbol 7583
00002   ABCB1   DASH    symbol 7583

OUT:
00001   BRCA3   BRCA33  BRCA55
00002   ABCB1   DASH    BASG    AVGA4
00002   ABCB1   DASH
-- 

How do you protect mail on web? I use http://www.2pu.net

["Angel in my armour, actress in my role."  -Rush]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to