On Sat, Feb 26, 2011 at 12:56 PM, Uri Guttman <u...@stemsystems.com> wrote:

> >>>>> "PK" == Parag Kalra <paragka...@gmail.com> writes:
>
>   >> why are you doing s/// against $_? by default it does that.
>
> you didn't rectify this one.
>

Oops. Missed that.


>
>
>  PK> Sorry. Hope this reply is better and so as the following code:
>
> much better.
>

Thanks.


>
>  PK> use strict;
>  PK> use warnings;
>  PK> while(<DATA>){
>   PK>         $_ =~ s/NM_(\d+)/$1:12345/g;
>
> i didn't follow the request carefully. that is dropping the NM_ part.
>

Good catch.

use strict;
use warnings;
while(<DATA>){
        s/NM_(\d+)/NM_$1:12345/g;
        print;
}

__DATA__
chr1    ucsc    exon    226488874       226488906       0.000000
-       .       gene_id "NM_173083"; transcript_id "NM_173083";
chr1    ucsc    exon    226496810       226497198       0.000000
-       .       gene_id "NM_173083"; transcript_id "NM_173083";
chr1    ucsc    exon    2005086 2005368 0.000000        +       .
gene_id "NM_001033581"; transcript_id "NM_001033581";
chr1    ucsc    exon    2066701 2066786 0.000000        +       .
gene_id "NM_001033581"; transcript_id "NM_001033581";



>
> uri
>
>
Thanks once again.

~Parag


>  --
> Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com--
> -----  Perl Code Review , Architecture, Development, Training, Support
> ------
> ---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com---------
>

Reply via email to