Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Cleaning up a text file with compact regex

by Samy_rio (Vicar)
on Apr 24, 2007 at 05:58 UTC ( #611656=note: print w/ replies, xml ) Need Help??


in reply to Cleaning up a text file with compact regex

Try like this,

TIMTOWDI

use strict; use warnings; my @content = <DATA>; @content = grep!/^\;/, @content; print @content[6..$#content]; __DATA__ <h3>Warning</h3><blockquote><FONT SIZE=+1 color=#aa0000><B> Circular contig NC_001224.1 leftmost feature 0 Q0050 le +ft neighbour Q0275 </B></FONT></blockquote><BR><HR SIZE=3> <h3>Warning</h3><blockquote><FONT SIZE=+1 color=#aa0000><B> Circular contig NC_001224.1 rightmost feature 18 Q0275 +right neighbour Q0045 </B></FONT></blockquote><BR><HR SIZE=3> >YJR152W|DAL5 TGATTTTGGATATTCATCAAAGGAAACCCTATTAATGGGTTTACCTACAGGTGCTGTTGA ATTGGTAGGTTGTCCACTTTTTGGTATTCTAGCAGTTTATGCAGCCAATAAGAAGATACC ATTTTGGAAATATAAGTTGAGTTGGGCTATTTTTGCAGCTGTCTTAGCATTGATTGCTAG CTGCATGTTAGGGTTTGCAACAAACTCCAAAAAAGCAAGACTGGCTGGTGCTTACCTGTG GTACATCTCGCCCGTCTCATTTATTTGCGTACTTTCCAATATCAGTGCGAATTCCTCGGG ATATAGTAAAAAATGGACTGTATCTTCAATAAACTTAGTAGCATATGCTGCAGCTAACTT GGCAGGACCACAAACCTTTATTGCTAAGCAGGCTCCTAAATATCATGGCGCTAAGGTCGC TATGGTCGTATGTTATGCTGTTATGATCGTGCTTCTATCTATACTGCTCATCGTCAATTT AAGGGAAAACAAGAGACGTGATAAGATAGCTGCCGAGAGAGGGTTCCCTGAAGAAACAGA GAATTTAGAGTTTTCTGATTTGACTGATTTTGAAAATCCAAATTTCAGATACACTTTATG >YKR039W|GAP1 CCTAGCTGAACAGAGATTTCTGCCAGAAATCTTTTCCTACGTTGACCGTAAGGGTAGACC ATTGGTGGGAATTGCTGTCACATCTGCATTCGGTCTTATTGCGTTTGTTGCCGCCTCCAA AAAGGAAGGTGAAGTTTTCAACTGGTTACTAGCCTTGTCTGGGTTGTCATCTCTATTCAC ATGGGGTGGTATCTGTATTTGTCACATTCGTTTCAGAAAGGCATTGGCCGCCCAAGGAAG AGGCTTGGATGAATTGTCTTTCAAGTCTCCTACCGGTGTTTGGGGTTCCTACTGGGGGTT ATTTATGGTTATTATTATGTTCATTGCCCAATTCTACGTTGCTGTATTCCCCGTGGGAGA TTCTCCAAGTGCGGAAGGTTTCTTCGAAGCTTATCTATCCTTCCCACTTGTTATGGTTAT GTACATCGGACACAAGATCTATAAGAGGAATTGGAAGCTTTTCATCCCAGCAGAAAAGAT GGACATTGATACGGGTAGAAGAGAAGTCGATTTAGATTTGTTGAAACAAGAAATTGCAGA AGAAAAGGCAATTATGGCCACAAAGCCAAGATGGTATAGAATCTGGAATTTCTGGTGTTA ;WARNING invalid query foo ;WARNING invalid query bar ;WARNING invalid query qux

Regards,
Velusamy R.


eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';


Comment on Re: Cleaning up a text file with compact regex
Select or Download Code
Re^2: Cleaning up a text file with compact regex
by chromatic (Archbishop) on Apr 24, 2007 at 17:53 UTC

    Just a note:

    my @content = <DATA>;

    Slurping genomic data into memory may be expensive in time and resources. In this case it may not be an issue, but data sets run large in bioinformatics, so line or chunk processing is often much more feasible.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://611656]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2014-10-26 08:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (152 votes), past polls