Help me format a list of phone numbers in Microsoft Word
July 23, 2007 12:28 PM   Subscribe

Help me format, for print, a giant list of phone numbers in Microsoft Word.

I have a pretty big file that is full of stuff like this:
Peace......See Justice of the Peace
Percentage..........555-5555
Performance and Payment 555-5555
Personal..................555-5555
It's from a ten year old paper document that we OCR'd. How can I get it to play nicely and treat those hardwritten serial periods (........) as flexible spacer between the left aligned words and the right-aligned numbers? Bonus points if your solution does not involve me dealing with each one of these ~3,500 entries manually.
posted by dirtdirt to Computers & Internet (5 answers total)
 
You could copy it all into Excel, then to a Text to Columns under the data menu, using the - character as delimiter (you have to type it in the other box on step 2 of the wizard. That will, unfortunately, create an extra column for names that have a dash in them, so you'll have to clean those up by hand, unless someone else can come up with a better solution.

Then, insert a column just before the column that has all of the -5555 data, and put a formula in that references the name column like this =(RIGHT,A1,3) where A1 is the column with the name data. This will give you a column with 555 values.

Finally, concatenate the two number columns with =B1&C1
posted by Pants! at 12:57 PM on July 23, 2007


If you do have names with dashes, you could just concatenate them back together after they get split apart.
posted by qldaddy at 1:05 PM on July 23, 2007


Edit --> Replace
Find "."
Replace with (tab)

Then find (tab)(tab)
Replace with (single tab) --> repeat until there are no more double tabs. Then align your tabs.

I think /t might be the character code for tab in word?
posted by croutonsupafreak at 1:15 PM on July 23, 2007


m/([^\.]+)/gi
will get you everything but spaces: so if you run that, and go through the results, you'll get a reasonable list of | name | number | rows.
posted by tmcw at 1:16 PM on July 23, 2007


Croutonsupafreak's answer got me on the right track - I replaced dots with tabs, and double tabs with single tabs until things were basically right. I then got one small chunk of formatting the way I wanted it, cut out the rest of the document and then repasted it in as plain text and it worked out pretty well. About 95 percent correct, and I am sure I can similarly automate some of the stuff that remains.

For the record, I think the Excel would probably work, I started to try it, but went for the easy way once it was presented to me.

Thanks!
posted by dirtdirt at 1:41 PM on July 23, 2007


« Older Jammed Throttle   |   Pimp my potty Newer »
This thread is closed to new comments.