UPDATE: Before anyone could reply, I had managed
to figure this out on my own! I was able
to extract words between two key words and
get the last word in a line (reverse) to
form a new sentence.
RCP
Took awhile to get back to Jay..but it did work the second time around....Thanks again.
I have a similar extraction request but with a twist,
as I'm trying to extract data between any two key words,
using a keyword to find a particular sentence.
Data: (contains several lines of data)
Board Name: just a test run Department: my1234
open (FILEH, "/tmp/aform");
while (<FILEH>) {
chomp;
open(MYOUTFILE, ">>/tmp/new_form");
if ( /Department/ ) {
$bname =~ /^Board Name:(.+)Department/;
print MYOUTFILE "$bname'\n";
}
close(FILEH);
close(MYOUTFILE);
I'm trying to get it to output only "just a test run"
to a file, but all I get is an error. How can I
also extract only the last word (my1234) from the same line?
error message I got...
Use of uninitialized value in pattern match (m//)
Use of uninitialized value in concatenation (.) or string
Thanks... RCP | [reply] [d/l] |