Microsoft KB Archive/212334

= WD2000: How to Convert Data in One Column to a Table =

Article ID: 212334

Article Last Modified on 12/6/2000

-

APPLIES TO


 * Microsoft Word 2000 Standard Edition

-



This article was previously published under Q212334





SUMMARY
When you use Word to merge documents, data cannot be located in a single column, as in the following example:

Peter Kelly

123 Main Street

Anytown, US 12345

Judy Lew

Microsoft

456 Elm Street

Sometown, US 67890

Instead, the information must be laid out in a table or in tab-delimited format, similar to the following:   Name         Company     Address           City/State     ZIP_Code Peter Kelly             123 Main Street   Anytown, US    12345 Judy Lew    Microsoft   456 Elm Street    Sometown, US   67890 This article explains how you can change data from being in one column to a format that Word can use.



Data Documents Created in Other Programs
If you created your data document in a different program, find out whether that program can save the data in a different layout. For example, if the data came from a database program, can it save the file with different field and record delimiters? If it can save the data with tab field delimiters and paragraph mark record delimiters, you can use the file in Word without any further modifications.

For more information about merging and using data sources, click Microsoft Word Help on the Help menu, type merging and using data sources in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

WordPerfect Data Documents
For additional information about using WordPerfect data documents with Word, click the article number below to view the article in the Microsoft Knowledge Base:

211702 WD2000: How to Convert WordPerfect Merge Data

Convert Text to Table in Word
If you created the list of addresses in Word or if you cannot rearrange the data using another program, convert the text to a table, which Word can use for merging. To do this, follow these steps:  Save the file containing the list of names with a different file name. Modify the version of the file with the new name (this way, if you make a mistake, you can start over with your original document). Rearrange the names in the file. The following steps require that each address is separated with a blank line (see the example in the "Summary" section at the beginning of this article).

NOTE: This method creates a separate field for each line in each address. If you want the information separated further than this, you must press the TAB key at the appropriate points. For example, if you have typed a first name and last name on the same line, the method below creates one field that contains both first and last names. If you want the first and last names to be in separate fields, you must place the insertion point between each first and last name and press the TAB key.

Also, this method puts the lines into the first available field for each record, so if the records do not have the same number of lines, shorter records end up with information in different fields than the longer records. If you want to perform conditional merges, in which a certain type of information is expected in certain fields, you need to edit the data file after you create the table.  Part 1: Remove Blank Lines Between Records Using the Following Steps:  On the Edit menu, click Replace. Click in the Find what box. Click Special, and select Paragraph Mark. (NOTE: If you don't see the Special button, click More to expand the dialog box.) Do this again, so that the Find what box shows "^p^p" (without the quotation marks).</li> If the No Formatting button is available (not dimmed), click this button to remove any additional Find formatting criteria.</li> Click in the Replace with box.</li> Type %%% (three percentage signs).</li> If the No Formatting button is available (not dimmed), click this button to remove any additional Replace formatting criteria.</li> Click Replace All.

The document now shows the beginning of each record next to the end of the preceding record, separated by three percentage symbols:

Peter Kelly

123 Main Street

Anytown, US 12345%%%Judy Lew

Microsoft

456 Elm Street

Sometown, US 67890

</li></ol> </li> Part 2: Replace Paragraph Marks with Tab Characters Using the Following Steps: <ol style="list-style-type: lower-alpha;"> Click in the Find what box, and delete the existing text.</li> Click the Special button and select Paragraph Mark.

The Find what box now shows ^p.</li> Click in the Replace with box, and delete the existing text.</li> Click the Special button and select Tab Character.

The Replace with box now shows ^t.</li>  Click Replace All.

The document shows all records in what appears to be one paragraph, similar to this: <pre class="fixed_text">  Peter Kelly  123 Main Street  Anytown, US  12345%%%Judy Lew        Microsoft        456 Elm Street   Sometown, US 67890 NOTE: This method produces one extra field when the final paragraph is replaced with a tab. You should delete this final tab. </li></ol> </li> Part 3: Replace the Percentage Signs with Paragraph Marks Using the Following Steps: <ol style="list-style-type: lower-alpha;"> Click in the Find what box, and delete the existing text. Type %%% (three percentage signs).</li> Click in the Replace with box, and delete the existing text.</li> Click Special and select Paragraph Mark. Click Replace All.</li> <li>Click Close to close the Find and Replace dialog box. The text is now in the proper format to be converted to a table.</li></ol> </li></ul> </li> <li>Select the text to be converted to a table.</li> <li>On the Table menu, point to Convert, and then click Text to Table.</li> <li>In the Separate Text At section, select Tabs.</li> <li>Click OK. The data is now in a table.</li> <li>Click in the first cell of the table. On the Table menu, point to Insert and then click Rows Above.</li> <li>In the first row, type a one-word field name for each column.</li> <li>On the File menu, click Save.

NOTE: As previously mentioned, if the data for a specific field is in different columns, you need to move the data for those fields to one column. If a column becomes blank, delete it by following these steps: <ol style="list-style-type: lower-alpha;"> <li>Place the insertion point into the column.</li> <li>On the Table menu, click Delete Columns.</li></ol> </li></ol>

The data document is now ready to merge with a Word mail merge main document.

Additional query words: howto grey convert percent

Keywords: kbinfo kbmerge KB212334

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.