maybe this will help, it uses regex to get all character between two words.
use strict; use warnings; my $file_content = ""; my $parsed = ""; open(INPUT,"<readbetween.txt") or die "cannot open readbetween.txt : $!"; while(<INPUT>){ my $line = $_; chomp($line); $file_content .= $line; } $_ = $file_content; while(/word1(.+)word2/mg){ print "$1\n"; #This is the content between the two words }
In reply to Re: Extracting specific Data
by jayto
in thread Extracting specific Data
by maheshkumar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |