utpalmtbi has asked for the wisdom of the Perl Monks concerning the following question:
I have a input file like ..
>or1|384514307---ATGAAGAGAATTAACTGGCAACGCTTAGCA ACCATTGGCTTGT
>or2|29377532ATGAAGAGAATTAACTGGCAACGCTTAGCA
... ..I want to trim the header line so that the output file become..
>or1---ATGAAGAGAATTAACTGGCAACGCTTAGCA ACCATTGGCTTGT
>or2ATGAAGAGAATTAACTGGCAACGCTTAGCA
For this, I use following scripts
But it retains the input header ..how can I delete the pipe and the bunch of number after that..while (<>) { if (/^(>\S+)/) { print "$1\n"; } else { print; } }
Plz help.. thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: trim header lines in files
by choroba (Cardinal) on Aug 05, 2013 at 13:09 UTC | |
|
Re: trim header lines in files
by rjt (Curate) on Aug 05, 2013 at 13:07 UTC | |
|
Re: trim header lines in files
by mtmcc (Hermit) on Aug 05, 2013 at 15:17 UTC |