http://www.perlmonks.org?node_id=421263


in reply to Genbank file parsing

if u want to extract Origin to // in the text file globally

you try this

undef $/; open (FILE, $ARGV[0]) or die "unable to open FILE\n"; my $input=<FILE>; close(FILE); my @final=(); while ($input=~m#ORIGIN(.*?)//#gsi) { push(@final,$1); } print @final;

input file "text.txt" contains

**********************************************

FEATURES Location/Qualifiers

/note="blah blah"

COUNT 200

ORIGIN

1 lots of nice info

61 lots of nice info

121 lots of nice info

//

ORIGIN

1 lots of nice info

61 lots of nice info

121 lots of nice info

//

ORIGIN

1 lots of nice info

61 lots of nice info

121 lots of nice info

//

ORIGIN

1 lots of nice info

61 lots of nice info

121 lots of nice info

//

***********************************

output file is look

**********************

1 lots of nice info

61 lots of nice info

121 lots of nice info

1 lots of nice info

61 lots of nice info

121 lots of nice info

1 lots of nice info

61 lots of nice info

121 lots of nice info

1 lots of nice info

61 lots of nice info

121 lots of nice info

Regards,

Senthi Kumar.k