[NTLUG:Discuss] reg exp question

Wrenn, Bobby J. Bobby.Wrenn at banctec.com
Wed Sep 19 09:53:52 CDT 2001


You guys were a great help last week, I am going to bone up on regular
expressions. However, since I was so successful last week, I have been asked
to extract the ZIP codes from an RTF file. Converting it to text it looks
like this:

=========================================
	Customer Name Site List	Store Type:	TRU
	Site ID	Site 	Site Address	Phone #1	Phone #2
Phone #3	Phone #4
	2801	Philly Whse	1 Geoffrey Drive	(215)736-8100
(215)736-8100	(   )   -    
	28	Fairless Hills	PA	19030
	28DC	Philly Whse	1 Geoffrey Drive	(215)736-8100
(215)736-8100	(   )   -    
	28	Fairless Hills	PA	19030
---------------Snipped some lines for brevity----------------------Next page
begins
	Thursday, May 03, 2001 01:11 PM	Page 1 of 49

	Site ID	Site 	Site Address	Phone #1	Phone #2
Phone #3	Phone #4
	5606	Ontario	1317 N. Mountain Ave	(909)983-5411
(909)983-0044	(909)983-9032
	56	Ontario	CA	91761
---------------Snipped to EOF
========================================

The ZIP is at the end of the second address line for each record, and is
separated from the state abbreviation by a tab. The page header has AM or PM
a tab and the word page. So I need to ignore non-numbers. Again if I can
copy this over to the Linux box and get an answer quickly, Linux scores and
we will be a step closer to getting an approved Linux workstation on the
LAN. Right now I have to keep it isolated so my free software doesn't infect
the NT herd.

Feel free to respond directly to me.

Thanks for the help

Bobby Wrenn
Sr. Service Planner
BancTec, Inc.
972.450.7832 




More information about the Discuss mailing list