I have an address list that has the name and address all on one line
(in one field). I.E. Bill & Sally Smith 1234 S Main St Denver CO
12345. Our mailing software can format the address if I could just
get the names into their own field. I just can't figure out how I
would like to do a find/replace to find the first space followed by an
integer and replace that space (not the integer) with a tab or better
yet put the names into a separate field, then move on to the next
record. Please forgive me if this sounds elementary, I am new to
filemaker.
Grip - 27 Aug 2008 21:05 GMT
On Aug 27, 1:50 pm, mich...@hooperprinting.com wrote:
> I have an address list that has the name and address all on one line
> (in one field). I.E. Bill & Sally Smith 1234 S Main St Denver CO
[quoted text clipped - 5 lines]
> record. Please forgive me if this sounds elementary, I am new to
> filemaker.
Well, I can tell you how to find the space before the first integer,
but that may not help.
What about John Smith PO Box 123 Washington DC 08610 or Tom Jones One
Hammerskjold Plaza New York NY 10128? If you have those cases, an $8/
hr data entry temp is the way to go.
With those caveats in mind, to get names, create a calc field with
this as the calculation, where field is the name and address field:
Let([
num = Filter(field; "1234567890");
num = left(num;1);
pos = Position(field; num; 1;1);
pos = pos -1;
names = Trim(left(field; pos))
];
names)
Michael H - 27 Aug 2008 21:09 GMT
> On Aug 27, 1:50 pm, mich...@hooperprinting.com wrote:
>
[quoted text clipped - 26 lines]
> ];
> names)
Phooey I didn't think about that issue. Thanks for the quick answer.
Lynn Allen - 27 Aug 2008 22:20 GMT
> I have an address list that has the name and address all on one line
> (in one field). I.E. Bill & Sally Smith 1234 S Main St Denver CO
[quoted text clipped - 5 lines]
> record. Please forgive me if this sounds elementary, I am new to
> filemaker.
Look at the Substitute, Position, RightWords, Right, Left and Middle
text functions.
The easy way to parse out that kind of address is to extract what you
know, and then remove it from the string, until the unknown part (the
name) is left.
So extract the zip code with RightWords, then Substitute out the string
in the Zip field in the original field. The remaining RightWord is the
State. Put that in the state field, then Substitute it out in the
original field.
The Address will almost always start with a number and except for names
like Joe Smith the 3rd won't conflict with the address. This should be
rare enough for manual correction. So test on the string for
"1234567890" and start there and bang everything to the right into the
Address field. Substitute out what's in the address field, and what's
left, once you use Trim, is the name.
Of course, PO Boxes cause some confusion. :/ Darn! I guess you could
test on "PO box" or "P.O. Box" and start the address there.
Patterncount is your friend.
This kind of text parsing is a pain even for experienced developers,
and it takes a lot of testing to get it right. A good hint is to build
"test" calc fields that SHOW what result string is returned for a
specific calculation.

Signature
Lynn Allen
--
www.semiotics.com
Member Filemaker Business Alliance
Long Beach, CA