Converting a Label-Style Text File into a Works Database (122045)



The information in this article applies to:

  • Microsoft Works 2.0
  • Microsoft Works 2.0a
  • Microsoft Works 3.0
  • 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

  1. Works 4.x: From the File menu, choose Open. Works 2.0 and 3.0: From the File menu, choose Open Existing File.
  2. Select the desired text file and choose OK.
  3. Choose the Word Processor button in the Open File As dialog to open the file as a word processing document.
  4. Works 3.0 and 4.x: From the View menu, choose All Characters. Works 2.0: From the Options menu, choose Show All Characters.
  5. 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.
  6. Works 3.0 and 4.x: From the Edit menu, choose Replace. Works 2.0: From the Select menu, choose Replace.
  7. 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
  8. 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
  9. 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
            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.
  10. Works 3.0 and 4.x: From the Edit menu, choose Select All. Works 2.0: From the Select menu, choose All.
  11. From the Edit menu, choose Copy.
  12. 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.
  13. From the View menu, choose List.
  14. From the Edit menu, choose Paste.
  15. Rename the Field Names as desired.

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.

Modification Type:MajorLast Reviewed:10/6/2003
Keywords:kbhowto KB122045