in reply to Extracting specific Data
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 }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Extracting specific Data
by maheshkumar (Sexton) on Jun 26, 2012 at 13:16 UTC | |
by jayto (Acolyte) on Jun 26, 2012 at 13:24 UTC | |
|
Re^2: Extracting specific Data
by maheshkumar (Sexton) on Jun 26, 2012 at 13:36 UTC | |
by maheshkumar (Sexton) on Jun 26, 2012 at 13:56 UTC | |
by Tux (Canon) on Jun 26, 2012 at 14:33 UTC |