;Released as public domain 28-Jan-1996 by the author Dave Dustin TrimLog V1.21 ~~~~~~~~~~~~~~~ (c) David Dustin / ECLIPSE Software 5th September, 1994 Preface ~~~~~~~ The programs and files in this distribution are freely distributable, but are also Copyright (c) David Dustin. They may be freely distributed as long as no more than a minimum fee is charged to cover time and copying costs. Permission is given for this distribution archive to be placed into Public-Domain collections such as the Amiga Library run by Fred Fish. They may also be made freely available to any REGISTERED Excelsior! BBS sysops, and may be placed on any Support BBS's for the Excelsior! BBS. If you do decide to make use of TrimLog, you are suggested to send any form of donation or gift as payment. This will get you the latest version of TrimLog, and also any other programs I have released. If you do have any suggestions, bug notes or ideas about this program, or if you would like to donate something, please let me know. Write to me at the following address: David Dustin 30 Richmond Ave Palmerston North NEW ZEALAND Or I can be contacted via: dave@eclipsnz.manawatu.gen.nz Contents ~~~~~~~~ 1. An introduction 2. Requirments 3. Usage 4. History 5. Future 6. Credits / Copyrights 1. An Introduction ~~~~~~~~~~~~~~~~~~~ TrimLog was written after a request by Renze. He was working on a Who's Called program to go with our Excelsior! BBS's, and normal programs that cut back a file to a required number of lines don't work, seeing as Excelsor! logs are very strange :) Also, TrimLog is now a normal TrimFile program as well, thus allowing you to reduce a file to a certain number lines very quickly. 2. Requirments ~~~~~~~~~~~~~~~ TrimLog can only be used on machine with at least V37 of the DOS library (seeing as Excelsior only works with V37+ I decided not to provide support for < V35 ). 3. Usage ~~~~~~~~~ TrimLog can only be used from the CLI/SHELL. The arguments available are: NAME/A,ENTRIES/N,S=STRING/K,L=LINE/S NAME - This is the name and path of the logfile to trim. ENTRIES - This is the number of entries you want left in the log. This defualts to 10. If you want more entries than there currently are available, then nothing will be changed. If the LINE option is selected, the defualt for ENTRIES is set at 100. SEARCH - This new option now allows you to use a differnt search string than the defualt one (\q1----). Simply type the string you want after the keyword, and it will use that as the identifier for the breaks. The searchstring is expected to be the START of the line at the start of each log entry. I will at sometime place a feature to allow you to have the searchstring as part-way along a line, and still work correctly, but until now, you will have to put up with the way it works. L=LINE - If either a L or LINE are present on their own in the command line, TrimLog will become a TrimFile program, reducing a text file to a certain number of lines from the bottom up. Each line can be as long as you like, as it uses the CR character as the terminator. Eg. If you had a text file which is 1000 lines long, and you went: TRIMLOG 500 LINE the file would now only contain the LAST 500 lines of the file 4. History ~~~~~~~~~~~ V1.00 23 January 93 * First release. V1.01 25 January 93 * Corrected error with write to disk routine. Would add several nulls onto the end of the file. V1.02 28 January 93 * Added TrimFile routine to code. Nows acts like TrimFile and reduces a text file to a certain number of lines. V1.03 8 July 93 * Changed the search string to work with the new log entries * Added option to work with FilteredLog files. V1.04 4 August 93 * Sycom changed the format of the Callers log again, and thus TrimLog was rendered useless. I simply changed the search string again, and removed the need for the Filtered option. V1.05 25 September 93 * Sycom once again changed the format of the log files, and thus, I had to change the defualt search string. * Added an option for a varable search string. V1.1 13 November 93 * Removed need for certain routines * Got rid of old bug testing routines * Added larger work space to handle files with more lines V1.11 29 Novemver 93 * Fixed a STUPID bug where I was addressing a byte instead of a word V1.20 4 September 94 * Re-wrote. - Improved speed (200% increase minimum) - Less memory used - Decent error handling - Replaced search function with a more intellegent routine - No more bugs (hopefully) - Reduced code size by 48 bytes (OH WOW! :-) V1.20a 5 September 94 * Bug fixed - Preventing you from trimming a file over 128 lines long. * Bug fixed - Would loose a byte if you tried to trim a 1 line file. V1.21 5 September 94 * Added "fool" checking. Now won't do anything if you try to trim a file to 0 entries/lines (delete the file if you want to do this :) * Removed over 150 bytes from binary by cleaning up code. 5. Future ~~~~~~~~~~ - Include a file requestor - Allow usage from WorkBench 6. Credits / Copyrights ~~~~~~~~~~~~~~~~~~~~~~~~ Main code - David Dustin Ideas/Bug testing - Renze de Ruiter TrimLog - (c) 1993-94 David Dustin Excelsior! BBS - (c) 1992-94 Sycom Devpac 3 - (c) 1985-92 HiSoft Kickstart/Workbench - (c) 1985-93 Commodore-Amiga, Inc.