Microsoft KB Archive/122045

= Converting a Label-Style Text File into a Works Database =

Article ID: 122045

Article Last Modified on 10/6/2003

-

APPLIES TO


 * Microsoft Works 2.0 Standard Edition
 * Microsoft Works 2.0a
 * Microsoft Works 3.0 Standard Edition
 * Microsoft Works 3.0a
 * Microsoft Works 3.0b

-



This article was previously published under Q122045



SUMMARY
Some third-party database programs cannot export files in a format Works for Windows recognizes, such as the dBASE format or tab- or comma-delimited (separated) text. For example, some export in the following label-style text format:

John Doe

1234 Main St.

Anytown, KS. 50000

Mary Doe

4321 1st Ave

Anytown, KS. 50001

If you cannot export the file to a format that can be directly imported into a Works database, then you will first need to open the text file as a word processing document and replace the field delimiters with tab characters and the record delimiters with carriage returns.

Label-style text files are a special case. Because they use the same characters, carriage returns, for both the field and record delimiters, you must first convert the multiple carriage returns that make up the record delimiters to an unusual character to keep the record delimiters from being lost. To convert a label-style text file into a Works database using this method, follow the steps in the following workaround.



WORKAROUND
 Works 4.x: From the File menu, choose Open. Works 2.0 and 3.0: From the File menu, choose Open Existing File. Select the desired text file and choose OK. Choose the Word Processor button in the Open File As dialog to open the file as a word processing document. Works 3.0 and 4.x: From the View menu, choose All Characters. Works 2.0: From the Options menu, choose Show All Characters. Make sure the format is similar to the above example, with a paragraph mark (backward P) after each line (each "field") and two paragraph symbols after each record. Works 3.0 and 4.x: From the Edit menu, choose Replace. Works 2.0: From the Select menu, choose Replace. Works 4.x: Click on the paragraph button twice to enter two paragraph marks in the Find What box and type ^n in the Replace With box, and then choose Replace All.

Works 2.0 and 3.0: Type ^p^p in the Find What box and ^n in the Replace With box, and then choose Replace All.

NOTE: ^p is the special character code for carriage return ^n is the special character code for a end-of-line mark</li> Repeat steps 6 and 7 above with "^p" in the Find What box and "^t" in the Replace With box.

NOTE: ^t is the special character code for tab mark</li>  Repeat steps 6 and 7 again with "^n" in the Find What box and "^p" in the Replace With box.

You should now have the following format <pre class="fixed_text">       John Doe    1234 Main St. Anytown, KS. 50000       Mary Doe    4321 1st Ave   Anytown, KS. 50001 with Tab characters between the name and address and between the address and city.

NOTE: You may opt to do further replacing to separate the city, state and zip fields, for example, before continuing with the following steps. </li> Works 3.0 and 4.x: From the Edit menu, choose Select All. Works 2.0: From the Select menu, choose All.</li> From the Edit menu, choose Copy.</li> Works 4.x: From the File menu, choose New and then choose Database from the Works Tools tab. Enter as many fields as there are items separated by tabs in the Word Processor document (in the example above, three fields) and name the fields as you wish.

Works 2.0 and 3.0: From the File menu, choose Create New File, and then choose Database.</li> From the View menu, choose List.</li> From the Edit menu, choose Paste.</li> Rename the Field Names as desired.</li></ol>

<div class="moreinformation_section">

MORE INFORMATION
As mentioned above, you can further separate the fields if there is some consistency in how the information is formatted. For example, the typical two spaces between the state and the zip code can be replaced with a tab to separate these two fields. You could also do selective replacing by choosing "Replace" instead of "Replace All."

For more information about how to perform this task in Works, see your Works printed documentation or online Help.

Additional query words: kbhowto ascii merge separator

Keywords: kbhowto KB122045

-

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

© Microsoft Corporation. All rights reserved.