Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Little pattern problem...

by johndageek (Hermit)
on Aug 22, 2003 at 21:03 UTC ( #285916=note: print w/replies, xml ) Need Help??


in reply to Little pattern problem...

does this do what you want?
#!/usr/bin/perl use strict; use warnings; my $start_target_name = ""; for (<DATA>) { ## line to process? if (/^>probe:/) { ## first record processing ($start_target_name) = /.*:(\d\d\d+_at:).*/ if ($start_target +_name eq ""); ## Got new target? or got not last target? if (!/.*:$start_target_name.*/) { print " do neat stuff for prior target $start_target_name\ +n"; ## set up for next target ($start_target_name) = /.*:(\d\d\d+_at:).*/; } } } ## process last set print " do neat stuff for prior target $start_target_name\n"; __DATA__ >probe:MOE430A:1415670_at:549:177; Interrogation_Position=2436; Antise + nse; GGCTGATCACATCCAAAAAGTCATG >probe:MOE430A:1415670_at:549:177; Interrogation_Position=2513; Antise + nse; GAGGAAACGTTCACCCTGTCTACTA >probe:MOE430A:1415670_at:467:433; Interrogation_Position=2521; Antise + nse; GTTCACCCTGTCTACTATCAAGACA >probe:MOE430A:1415670_at:254:643; Interrogation_Position=2533; Antise + nse; TACTATCAAGACACTCGAAGAGGCT >probe:MOE430A:1415670_at:54:269; Interrogation_Position=2556; Antisen + se; CTGTGGGCAATATTGTGAAGTTCCT >probe:MOE430A:1415670_at:405:339; Interrogation_Position=2583; Antise + nse; GAATGCATCCTTGTGAGAGGTCAGA >probe:MOE430A:1415670_at:60:395; Interrogation_Position=2597; Antisen + se; GAGAGGTCAGACAAAGTGCCAGAAA >probe:MOE430A:1415670_at:284:165; Interrogation_Position=2619; Antise + nse; AAAACAAGAACACCCACACGCTGCT >probe:MOE430A:1415670_at:622:145; Interrogation_Position=2634; Antise + nse; ACACGCTGCTGCTAGCTGGAGTATT >probe:MOE430A:1415670_at:291:661; Interrogation_Position=2804; Antise + nse; TATCTTGTCCAACACTACGTCGAAG >probe:MOE430A:1415670_at:146:701; Interrogation_Position=2956; Antise + nse; TTGTCACCATGCCTGCAAGGAGAGA >probe:MOE430A:1415671_at:116:525; Interrogation_Position=1156; Antise + nse; GGAACAGGAATGTCGCAACATCGTA >probe:MOE430A:1415671_at:655:137; Interrogation_Position=1173; Antise + nse; ACATCGTATGGATTGCTGAGTGCAT >probe:MOE430A:1415671_at:398:139; Interrogation_Position=1232; Antise + nse;

Good luck!
dageek

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://285916]
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: (2)
As of 2020-05-25 02:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (143 votes). Check out past polls.

    Notices?