AppleWorks J __________________________________________________________________ Reading Tab Delimited Text Files into AppleWorks 1.x and 2.x __________________________________________________________________ Note: AppleWorks 3.0 can read text files in either tab delimited or return delimited format. This new capability eliminates the need for the workarounds described below. 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, to replace the tab delimiters with carriage returns. Using a word processing application, open the document and change the tabs to carriage returns with a Replace command. A programming language can also be used. Below is example created 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 Save this program along with the exported text file to a ProDOS disk. After substituting appropriate names in lines 20 and 30, run the program. Tabs will be replaced with carriage returns. The new text file can be read correctly into the AppleWorks database. Below is a MacPascal program that replaces tabs with carriage returns in a Macintosh text file. 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 Microsoft Works or MacTerminal), save the captured file as a text file. The AppleWorks database should read the new text file correctly.