extract a value from a field in a file
- From: nufin <nufin>
- Date: Wed, 29 Jun 2005 18:27:42 +0200
Hello,
I need to extract from a file values of the "QRKPageBegin" field. Into the file, the fields appear like following: %%QRKPageBegin: 2 %%QRKPageBegin: 4 %%QRKPageBegin: 5
I would like to extract each of the values of this field, to set a list.
Actually, (I am a perl newbie), I wrote the following code
open (PS,$PSFile) or die "Could not open the file $PSFile: $! \n";
$/ = "\r"; while (<PS>) {
while (/([%%QRKPageBegin\s]{14,})/g) {
print $1, "\n";
}
}
close PS;However it display/get the field but not the value, so any help would be greatly appreciated !
Best Regards, Tof
.
- Follow-Ups:
- Re: extract a value from a field in a file
- From: Gunnar Hjalmarsson
- Re: extract a value from a field in a file
- From: Mark
- Re: extract a value from a field in a file
- Prev by Date: FAQ 7.12 What's a closure?
- Next by Date: Re: extract a value from a field in a file
- Previous by thread: FAQ 7.12 What's a closure?
- Next by thread: Re: extract a value from a field in a file
- Index(es):