Convert multiple lines of text to a single cell in a table

D

Dan_unique

I have "records" that contain varying number of lines of text in each
record. Each line has a carriage return at the end (^p). Each record is
separated by two carriage returns (or I could put in a delimeter such as the
pipe symbol on this line if it helps).

I want to put each "record" in its own cell when I convert text to table. If
I do the straightforward conversion, each line in each record is in its own
cell.
 
S

Suzanne S. Barnhill

Replace ^p with ^l; then replace ^l^l with ^p. This will give you each
record in a separate paragraph. Convert Table to Text separating at
paragraphs and using the appropriate number of columns.

Better still substitute tabs for the line breaks, and separate at the tabs
to make a row for each record. This will create a database that you can use
as a mail merge data source for not only the current label layout but any
other that may be needed (or envelopes or letters or anything else).
 
D

Dan_unique

Thanks Suzanne. I sort of stumbled over the same approach myself. I am still
playing with the Macro to make it one click of the button. :)

As for the mail merge option: that will work if I put a "header row" as the
first record. If I run it just as is, mail merge will look for the name of
the person who was #1 in my database as the first field when I set the
mailmerge template up. :). I will also have to assume that a record has a
maximum number of lines In theory, it's infinite. In practice it's probably
about a dozen.

I don't want to put in a header record as I would like to be able to print
the report "stand alone."

The reason I want to put the record in a single cell is I then: remove the
border, set the rows so they don't break across the page, add some top and
bottom buffers, and then apply three columns to the page. The result is a
directory-like listing of my records where nothing gets orphaned.

Although the mail merge option might not work for this specific application,
I like the technique it implies: the ability to convert rows down to columns
accross. I am sure that will come in handy somewhere.
 
S

Suzanne S. Barnhill

You don't need a table for what you want to do, though. If you convert each
record to a single paragraph (as already outlined), format the paragraph as
"Keep lines together," add Space Before/After as needed, and then flow it
into three columns, you get the same effect.
 

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