Converting ASCII tables to Word tables

R

Robert Morley

Is there an easy way to convert an ASCII table to a Word table in Word XP?
I've found that interestingly enough, if I hit Enter at the end of an ASCII
table line, Word will insert a Word table with all the same column
divisions, properly aligned with the previous ASCII text row, but despite
that capability, it appears to be unable to actually convert from an ASCII
table to a Word table directly.

If it makes a difference, in this case, the ASCII table format is:

+-------+-------+
| Col 1 | Col 2 |
+-------+-------+
| Text | Text |
+-------+-------+

Doing a Convert Table to Text with | as the delimiter does a partial job,
but I'm hoping there's some better way of doing it than that.


Thanks,
Rob
 
S

Suzanne S. Barnhill

What's happening when you press Enter at the end of an ASCII row is based on
your settings wrt "Apply as you type: Tables" on the AutoFormat As You Type
tab of Tools | AutoCorrect Options. Unfortunately, the AutoFormat tab
doesn't include "tables" as an option, so AFAIK, there is no way to
accomplish what you want other than row by row.
 
R

Robert Morley

Thanks Suzanne. I hadn't clued into the fact that that was coming from
AutoFormat As You Type, though I hadn't really thought about it either. I'm
not entirely surprised that there's no facility to convert an ASCII table to
a Word table.

I suppose I could always make a macro in VBA...just ignore the +---+ lines
and parse the pipe-delimited lines. It's not a big project I'm working on,
so I'll think about it and decide later. :)


Rob
 
S

Suzanne S. Barnhill

Shouldn't even require VBA. Use Find and Replace to replace the +---+ lines
with nothing, then use Table | Convert | Text to Table separating at <pipe>.
 
R

Robert Morley

Yeah, I've tried that, and it works to some degree, but it's a
less-than-perfect solution since it has no ability to merge multiple
consecutive piped lines into a single row, and also leaves a lot of spaces
in the table.


Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top