Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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';

Replies are listed 'Best First'.
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 making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2016-07-27 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (242 votes). Check out past polls.