[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to read >50K text files ?



In article <2je4of$qa6@hermes.unt.edu>,
Phillip "Ty" Young <tyoung@jove.acs.unt.edu> wrote:
>problem:  downloading, say, a 60-100K text file (i.e., zen and the art
>of the internet, a (I think) 140K text file) impossible using an
>early-generation of AppleWorks (like 1.3) since the desktop only allows
>you to go up to 55k.  Is there a free or shareware program that allows
>for reading in really BIG files?  One that has a print routine, including
>control character capability, would be helpful.  Thank you for your help!
>
>TY




You could write a program to split the file into segments fairly easily.  I 
routinely use files that are far larger than my system--I just can't look at 
them all at once.  The guts of the routine would be something like this:

(Applesoft/DOS or ProDOS)
5 fl= (insert # of characters):sl=0:sg=1
10 input "Name of big file:  ";F$:input "Max. segment size (bytes):";ms
15 print chr$(4);"open "F$
20 print chr$(4);"open "F$".S"sg
25 print chr$(4);"read"f$:get q1$:print chr$(4);"write "f$".S"sg:print 
q1$;chr$(4)
30 cp=cp+1:sp=sp+1:if sp<ms and cp<fl then 25
35 if sp=>ms and cp<fl then print chr$(4);"close "f$".S"sg:sg=sg+1:sp=0:goto 20
40 print chr$(4);"close"

Of course, neither DOS nor Applesoft likes lower-case commands, so adjust 
accordingly.  Note also that the above routine is theory...but sound theory.
Actually, line 25 might not work right due to GET command handling 
restrictions.  It may require a PRINT CHR$(4): before the PRINT 
CHR$(4);"WRITE..." command for it to work right.  For the curious:  printing a 
Ctrl-D while READing or WRITEing a text file will cause the read or write 
operation to stop.  In Line 25, this allows you to print a carriage return 
after printing Q1$, without putting the carriage return into the file.

--Dave Althoff, Jr.
(DOS 3.3 text-file guru, often handy with a Q&D fix that doesn't require a 
download...I can't download to my Apple ][ 8-( )