in reply to Re: how to isolate text in a text file.
in thread how to isolate text in a text file.
that's a nice script, 1nickt....
$ ./1.dna.pl Found AATCCGCTAG in line 4 $ cat 1.dna.pl #!/usr/bin/perl -w use 5.011; my $txt = q{ Uninteresting line. More boring stuff. Here's the AATCCGCTAG string. Afterwards, more drivel. Footnotes, etc. }; my @lines = split "\n", $txt; my $counter = 0; for my $line ( @lines ) { $counter++; next unless $line =~ /(\b[ACGT]+\b)/; say "Found $1 in line $counter"; } __END__ $
|
|---|