AnsweredAssumed Answered

Text formated as "labels" to something more useful?

Question asked by flybynight on Oct 2, 2013
Latest reply on Oct 2, 2013 by raybaudi

Not necessarily a FMP question… if the easiest solution is with FMP, that's cool. If there is a way to do this with a text editor like TextWrangler, I'm all ears for that too! Here goes…

 

We have a client that has a "mailing list" that isn't in a list format. It was formatted to print on Avery labels. What we received is a PDF, that had been created from Word. Our client does not have access to whatever created the list.

 

What I am able to do is select all of the text in Acrobat and copy-paste it into a text editor, or whatever.

The problem is that it is not delimited in any nice way to differentiate fields and records. Basically, both fields and records are delimited with a return. So it looks something like this:

 

Name

Title

Address

City, ST Zip

Name

Title

Address

Address2

City, ST Zip

etc...

 

Note that MOST of the records have 4 lines, but some have 5, and a few have 3. Some addresses have commas in there, so I can't identify the City line as being the only line with a comma. What I can do is manually go through and force everything to be 4 lines (combine address 1 and 2 when necessary.

 

From that, does anyone have any tips to do a find-replace the first, second and third returns with a tab, but keep the fourth return, then repeat that pattern? Can I do something like that with a looping script in FMP?

 

Thanks for any ideas!

-Shawn

Outcomes