On Friday 12 March 2004 Mark Allen wrote:
> I've got a physical file (actually copy of a spool file) containing
> phone #'s in format xxx-xxx-xxxx.  I need to send this to a software
> vendor but for privacy reasons I need to change all the phone #'s to
> "fictitous" numbers i.e. change 706-678-9565 to 945-224-4848 or such.
>  The phone numbers start in a various # of places in the file (i.e.
> some might start in position 33 others 55, 87 etc.) I've been racking
> my brain for a quick and dirty way to this without having to manually
> edit the file.  Any ideas from some of you genius' out there?

Hi Mark

Quite a few years back we needed to pick out UK postcodes to put into a 
dedicated postcode field. They could appear in any one of four lines of 
address, or not at all. I resorted to simplifying the patterns to search 
for. Used xlate on each line to convert all alphas to A and all digits to 
1, so there was just a fixed set of patterns to search for (AA1 1AA, AA11 
1AA, etc). Extracting the postcode from the original (un-xlate'd) field 
using the pattern start position was straightforward then. 

You could try a similar approach looking for 111-111-1111, which should be 
a lot easier with RPGIV (for example) than it was with RPG/400!

Regards, Martin
-- 
martin@xxxxxxxxxx  AIM/Gaim: DBG400dotNet  http://www.dbg400.net   /"\
DBG/400 - AS/400 & iSeries Open Source/Free Software utilities     \ /
Debian GNU/Linux | ASCII Ribbon Campaign against HTML mail & news   X
                                                                   / \

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.