Is there an edit that can do this?

Kenneth Brody kenbrody at spamcop.net
Fri Aug 21 14:34:48 PDT 2009


Boaz Bezborodko wrote:
> Part of me offers this up just to see how quickly Ken can come up with 
> something.  (I know that I just don't do recursive thinking as easily.)
> 
> I am setting up a program to process a CSV file.  One of the data lines 
> is an address field that has the entire address in one field with the 
> data elements each separated by a string of 8 spaces.  I was wondering 
> if it is easy to create an edit that replaces each set of 8 spaces with 
> some other character for which it would be easier to search.  One little 
> difficulty is that there can be a string of 16 spaces when no 2nd 
> address line exists, which is most of the time.
[...]

Is it literally "replace any sequence of 8 spaces with (some character)"? 
That took me about a minute, including fixing it to not treat trailing 
spaces as something to convert.

     { ( {!" "!}@ ) | ( !"        "!<"~"> ) | * }

This will convert any sequence of 8 spaces to a tilde.  Change the choice of 
character as you see fit.

Your example:

Joe Shmoe        1136 Feather Grass Ln                Raleigh,
NC-27613

is converted to:

Joe Shmoe~1136 Feather Grass Ln~~Raleigh,~NC-27613

-- 
Kenneth Brody


More information about the Filepro-list mailing list