Description: AppleWorks: Creating database documents from text with tabs Header: AppleWorks: Creating database documents from text with tabs Some database programs export text files that have fields separated by tabs and records by carriage returns. AppleWorks imports a database file from a text file when all fields and records are separated by carriage returns. To convert the tabbed export format to the format AppleWorks imports, you must use a word processing application or a programming language, such as BASIC or Pascal, whether or not you have to transfer the data from the Macintosh. Using a word processing application, open the document and change the tabs to carriage returns with a replace command. Most applications have special codes for the tab and carriage return, such as ^t and ^p in MicroSoft Word. Save the changes as a text file, which AppleWorks should accept. For using a programming language, take this example in Applesoft BASIC under ProDOS. 10 ONERR GOTO 130 20 O$="" 30 N$="" 40 D$=CHR$(4) 50 PRINT D$"OPEN"O$ 60 PRINT D$"OPEN"N$ 70 PRINT D$"READ"O$ 80 GET A$ 90 PRINT D$"WRITE"N$ 100 IF A$=CHR$(9) THEN A$=CHR$(13) 110 PRINT A$; 120 GOTO 70 130 PRINT D$"CLOSE" 140 END This program should be saved, along with the exported text file, to a ProDOS disk; save the program with a name such as "TAB2CR". After substituting appropriate names in lines 20 and 30, run the program. AppleWorks should accept the output file. Here is a MacPascal program that could convert the export file of a Macintosh application such as MacWorks. program Convert; type text = file of char; var infile, outfile : text; c : char; begin {an example pathname could be 'HD:MS Works:ExportFile'} open(infile, 'export file pathname'); open(outfile, 'AppleWorks format file pathname'); while not (eof(infile)) do begin read(infile, c); if ord(c) = 9 then begin c := chr(13); end; write(c); {echo to screen} write(outfile, c); end; close(infile); close(outfile); end. Substitute appropriate names for "export file pathname" and "AppleWorks format file pathname". After transferring the output file to the Apple II (with MS Works or MacTerminal), save the captured file as a text file. AppleWorks should accept the captured file. Apple Technical Communications Keywords: