Text File Splitter v1.1 by Eric D. Shepherd ----------------------------------------------------------------- Equipment: Any Apple II with 128k RAM Needs: ** ShrinkIt 3.0 or later is needed to unpack this file This program is placed into the public domain. Share and enjoy! OS: ProDOS What is Text File Splitter? --------------------------- Text File Splitter is a simple BASIC program which splits large text files into several sections for easier manipulation. For example, if you have a 200K text file, but only 128K of memory in your Apple II, you can use TFS to split the file into sections small enough to load into the AppleWorks word processor. I wrote it for a friend who had downloaded a 180K file from the Internet... but only had 46K free by the time he loaded AppleWorks. Using TFS, any size text file can be split into as many sections as you like. NOTE: Text File Splitter requires that each line of the text file be terminated with a carriage return character (ASCII $0D, 13 decimal). If you've used Kermit to download the text file to your Apple II, this will likely be the case. By "line", I mean any block of text of up to 255 characters in length. Using Text File Splitter ------------------------ Text File Splitter does very little error handling. If an error occurs while TFS is working, it simply closes all the files it's working with and gives up, telling you what went wrong. Make sure your destination path has enough room for the new files. To use TFS, run the "Splitter" program. It will ask you to enter the pathname of the file to split. This must be enough of a pathname for ProDOS to find the file. If the text file is in the same directory as TFS, typing just the name of the file will suffice. Otherwise, include a full or partial pathname, as necessary. You will then be asked to enter the path for the new files. What you enter must be a valid pathname. Keep in mind that TFS appends several characters to the end of this name. For example, if you want to split the file "LIB.OF.CONG.IDX" into several sections, you might type a destination path of "/MYDISK/INDICES/CONGRESS". The file segments will then be named "CONGRESS.1", "CONGRESS.2", etc. Next, you may enter the number of lines to be in each file segment. You may enter any decimal number here (entering 9.2 or 0 would be bad). The file will then be split into the number of sections required to have all segments no longer than you've specified. Text File Splitter can also be good for beginning programmers to play with and get practice modifying programs. It is lightly documented, but the code is fairly straightforward. Try improving the error handling and adding a more friendly interface. There will be a quiz on Monday. :) Version history --------------- 1.0 Initial release. 1.1 As soon as 1.0 was released, I realized that I made a stupid mistake. Any text file with commas or quotation marks would not be handled properly because I was relying on the Applesoft INPUT statement. This has been corrected by including a machine language program, INPUT, with TFS. This program, when BRUN, adds an &INPUT command, which allows any characters to be entered as input. The command is used as follows: & INPUT For example, "&INPUT X$". I don't know where the &INPUT command comes from, to be totally honest. I had it printed out on a sheet of paper with the label "Input anything routine". ------------------------------------------------------------------