Word table to aligned text columns?

E

Ed

We have a high turnover rate of employees who turn in field reports in Word.
These reports all go to the Database Input workgroup. Our database works
with monospaced plain-text input fields of fixed widths and has no clue what
"MSWord" or "formatting" means. Whenever a field report is turned in with
several pages of data columns - always in either Times New Roman or Ariel
and always either in a table or neatly spaced columns - everything goes to
pot when the files are converted to monospace (usually Courier New 10 pt.).
Tables and tabs are not recognized.

The last one took over six hours of hand typing to get the columns aligned!
Is there a macro, function, or other work-around we can use in Word to
alleviate some of this?

Ed
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Could your program deal with the input better if it was in an Excel
spreadsheet? If you copy and paste the table into Excel, the data in each
cell in the table will end up in a separate cell in the Excel spreadsheet.

You haven't really given us enough to go on concerning the way in which the
Database input works.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 
E

Ed

I'm sorry, Doug, for not being more clear. The problem is not so much in
interfacing with the database program, but in formatting the Word document
into something acceptable. I'm not real sure how all this fits into the
database, except that the output is every line a separate paragraph of fixed
width.

The docs in question are, when ready, imported into the database as a whole
file using a database command. This is a "legacy" proprietary program, and
has nothing in common with Word except the computer keyboard! The problem
is that if a field report is imported without adjusting these columns first,
the database reformats the text to monospace, expanding spaces and skinny
letters, which wraps the lines around to the next line and destroys the
whole "table" look and feel. This, then, must be manually adjusted by
deleting spaces until the text aligns - tedious to say the least with six
columns over 10 or 12 pages. Unfortunately, the database does not recognize
tables or multiple columns, only plain text.

The real solution would be to get every field report writer to use a
template of fixed width formatted with a monospaced font - if it looks good
there, it stands a good chance of importing correctly. This has been tried
several times, though, and doesn't work with any consistency. That leaves a
solution here in this office, if there is one. Any suggestions are welcome.

Ed

"Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS"
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Ed,

If the 6 hours of typing involved inserting spaces to get the columns to
line up, it would be possible to write a macro that padded out the entry in
each cell of the table with the required number of spaces. Does that sound
like the way to go?

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 
E

Ed

I was thinking about how to approach this. Normally, the text would not be
in a table or in formatted columns - just typed on a page and spaced to look
nice. How to get that into nice spaced-out columns in a mono-spaced font
could be a bear! I'm thinking something like this:

1. Select the information. If it's not already in a table, then it's
spaced-out columns. Within the range of this selection, use Find/Replace
until every multiple space is now only one space - that is, each item is now
separated by only one space across each row. Then put into a table.

2. I've got a maximum of 72 character spaces. If I could find the
character length of the longest item in any column, I could set some
parameters and add spaces as required. Like: if there are 6 columns in the
table, and the character length of the longest item in the last column is 7,
then I will have 5 columns to fill across 72-7=65 spaces. Each column then
will be 65/5=13 spaces wide.

3. Now I add spaces into each column. If the longest item in Col. 1 is 5
spaces, then I add 8 spaces at the end of the text in each cell down Col. 1.
Repeat for Cols. 2-5 to make each equal 13 spaces (for this example).

4. Finally, convert this table to text. It should be fairly close to what
I need, and fit within my page margins. It will probably need a bit of
manual clean-up, depending on the varying lengths of the items in each
column. But I should have each line within my 72-character limit, which is
a big head start.

Does this sound like a good plan? Or is there a better way?

Thanks for all your input, Doug.
Ed

"Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS"
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Ed,

That maybe the sort of thing that you have to do, but I would be quite
surprised if the database cannot accept input from a delimited file where
each piece of data is separated by a delimiter character - usually a comma
but sometimes with the data in quotes as well. The ability of databases to
import/export data in that format has been around for many, many years.

Only one other comment is that if the data is spaced to look nice, it was
probably spaced using tabs. It is very difficult to get the spacing right
using the spacebar if a proportionally spaced font is used.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 
E

Ed

I didn't think about the tabs, Doug. Thanks for reminding me.

Unfortunately, this stuff, while going into a database, is going into the
"Narrative" fields of the database. It's going to look at each single line
of the text from margin to margin as one data field. When the database is
queried for the Narrative to one of these record sets, it looks for all of
these text fields and strings them together in sequential lines, each one a
separate paragraph. As such, you can't input separate numbers and have the
database compile a table to put into the narrative - it's got to be done by
spacing everything so it matches from line to line.

Yes, a new database *would* be nice. But we've been screaming that for over
15 years, and nobody's listening. In the meantime, it's job security! 8>)

Ed

"Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS"
 

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