[Gllug] Extracting a range of Lines from a file

Jackson, Harry HJackson at colt-telecom.com
Thu Mar 21 13:17:15 UTC 2002


Hi all

Im afraid its another Perl question.

If I want to extract a range of lines on a text match I was thinking along
the lines of the following.

while ($current = <EXTRACT>) {

		if ($current =~ /^(.*?12\/12\/2000.*?$/ ..
/^(.*?12\/01\/2001.*?)$/ ) {
		    Do stuff on the range here;
			}	
		}

What I thought this would do was only give me the text between these two
matches. As you can probably guess this is not the case. I am able to
extract line ranges by number but not on the match. I have got the Cookbook
here which is were I got the idea from but no joy.



Regards;
Harry Jackson.


     


*************************************************************************************
COLT Telecommunications
Registered in England No. 2452736
Registered Office: Bishopsgate Court, 4 Norton Folgate, London E1 6DQ
Tel. 020 7390 3900

This message is subject to and does not create or vary any contractual
relationship between COLT Telecommunications, its subsidiaries or 
affiliates ("COLT") and you. Internet communications are not secure
and therefore COLT does not accept legal responsibility for the
contents of this message.  Any view or opinions expressed are those of
the author. The message is intended for the addressee only and its
contents and any attached files are strictly confidential. If you have
received it in error, please telephone the number above. Thank you.
*************************************************************************************


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list