CHANGE-A-FILE by Harold D. Portnoy ====================================================================== Be sure to copy CHANGE-A-FILE before using!!! --------------- CHANGE-A-FILE is distributed partly FREE (5 utilities) and partly as SHAREWARE (6 utilities). The following utilities are shareware and require a password: Convert AWP File to TXT File Convert TXT File to AWP File Convert AWP 3.0 to 2.x File AWP File Doctor - AWP repair utility Exhume AWP File - AWP repair utility Restore ADB File - ADB repair utility The same password also unlocks the Auto-Restore functions of the AppleWorks file repair program, RESURRECTION, which can recover files even when disk directories are damaged. To obtain the password, send $10.00 to: Change File c/o Harold D. Portnoy 1431 Woodward Bloomfield Hills, MI 48302 To obtain unlocked versions of Change-A-File and Resurrection on a disk including documentation and password (for future versions), send $10.00 plus $4.00 for disk, postage and handling. REGISTERED SHAREWARE USERS: If your password contains control characters then substitute the same regular characters for the control characters in the password. ********************************************************************** When an AppleWorks word processor or data base file goes bad is not the time to worry about how you are going to repair the damage. AWP File Doctor and Restore ADB can repair these files. With RESURRECTION, which can restore files from a bad directory, virtually any bad file can be restored. Each of these utilities, alone, are worth the small fee in time saved. ********************************************************************** CHANGE-A-FILE is a batch file utility that reads AppleWorks Word Processor (AWP) and text (TXT) files; converts AWP files to TXT files, TXT files to AWP files, and AWP 3.0 files to AWP 2.x files; restores damaged AWP and ADB (data base) files; change file or auxiliary type codes, and strip or insert line feeds. Up to 88 files in a directory or subdirectory can be altered. This program uses the ProSel format. CHANGE-A-FILE is particularly useful to the AppleWorks (AWKS) user and to prepare files for uploading or alter files after downloading. Password CHANGE-A-FILE is a system file. When run, the user is initially presented with a password screen. Entering the password allows the user to access all of the program's utilities. If the password is not entered only the first 5 utilities listed below can be accessed. The locked utilities will be shaded in the menu. Activating protected utilities and removing password screen Transfer Change-A_File, Resurrection, and the Password program to any directory. The Password program can be used on all versions of Resurrection, but only on version 4.14 or greater of Change-A-File. The Change-A-File program should be re-named CF.SYSTEM. Run either CF.system or Password. Password can be used independent of Change-A-File and can be used to unlock Resurrection alone. Enter the password. Change-A-File will be unlocked and the password screen removed. This is indicated by the notice 'CF.SYSTEM unlocked'. Rename the file to CHANGE.FILE or any other name of your choice. If you use CF.system to unlock Change-A-File the password screen will be removed whether you have the correct password or not. If you use the Password program, the screen is removed only if the password is correct. If you enter the password, all the utilities will be able to be used. If not, only the 'free' utilities will be able to be used. If RESURRECTION is placed in the same directory as CF.SYSTEM, the Auto-Restore functions will also be unlocked on entering the password. This is indicated by the notice 'RESURRECTION unlocked'. Menu The program menu is as follows: ________________________________________________ Q- Quit V- View F- Change File Info L- Strip Line Feed C- Strip Control Character I- Insert Line Feed X- AWP 3.0 to 2.x File W- AWP File to TXT File T- TXT File to AWP File E- Exhume AWP File D- AWP File Doctor R- Restore ADB File ________________________________________________ The appropriate utility can be selected from the main menu with the light bar selector, by entering the appropriate letter or by using the mouse. Pressing RETURN, a letter or the mouse button accepts the selection. Directory Selection The volume directory name is the initial default directory. The default source directory or destination directory can be accepted by pressing RETURN or mouse button. Any directory online can be entered. These directories will remain the default directories until changed or the program is quit. The TAB key tabs to the next slash in a directory pathname and then to the end of the pathname. Control-X switches the source and destination directories. Control B or N move the cursor to the beginning or end of the line. Control E inserts characters at the cursor. The DELETE key deletes the character to the left of the cursor while control D deletes the character under the cursor. Alternately, the prefix can be selected by pressing the Closed Apple (Option) key. A list of directories is presented from which one can be selected in a manner similar to that in AppleWorks (AWKS) 3.0. The up and down arrows or the mouse move the light bar selector, RETURN or the mouse button selects a subdirectory and Open Apple-RETURN accepts the completed directory name. If an error is made, pressing TAB lets you restart the selection. File Selection Files are selected or deselected with the spacebar or mouse button. A check mark is placed in front of the selected file. The light bar can be positioned using the four arrow keys or mouse. When using the spacebar or mouse button to select a file, the selection is made in the direction first initiated. Entering Control A selects all the files. After selecting the desired files, press RETURN. ESCape always returns you to the main menu. The Utilities Convert AWP 3.0 to 2.x file. Usually AWP files generated by Appleworks 3.0 cannot be read by versions 2.1 and below. If you do not have version 3.0, an AWP 3.0 file can be read by your version of Appleworks by converting the AWP 3.0 to an AWP 2.x file. The suffix ".X" is added to the file name. If the original name is greater than 13 characters, the last two characters are replaced with the suffix. This utility is particularly useful for those AWKS 3.0 users who would like to upload AWP files that can be read by all versions of AWKS. The AWP 3.0 file is not converted if it is already compatible with the AWP 2.x format and the source and destination directories are the same. This is indicated by a bell and a diamond replacing the check mark. Convert AWP to TXT file. This utility converts AWP files into text files. In preparation for uploading, each line is followed by a carriage return. If you want a carriage return only at the end of a paragraph, press the Open Apple and RETURN keys when indicated on the screen. The text file created is designated by the suffix ".W" added to the original file name. The original file is preserved. The auxiliary file code is changed to $0000. Convert TXT to AWP file. This utility converts TXT files into AWP files. The conversion, particularly of multiple files, is considerably faster than using the AppleWorks from text file option. The new file is designated by the suffix ".T" added to the original name. The original file is left undisturbed. When loaded into AppleWorks, the file may not properly word wrap. This is easily corrected by changing any margin justification. AWP File Doctor. When an AWP file is damaged, it cannot be loaded into AppleWorks instead the 'Getting error trying to read ...' message is displayed. The AWP File Doctor will almost always restore the non-corrupted portions of an AWP file to a new file that can be loaded into AWKS. The restored file has the suffix ".D" added to the file name. Asterisks replace the bad bytes, however, if the bad bytes are text characters, these characters may be displayed. The characters usually make no sense and are easily identified. Except for the damaged text, the new file requires no revision. If the file is loaded into AWKS 2.x and the 'Getting error .." message is still displayed, first convert the file to AWP 2.x format using Convert AWP 3.0 to 2.x, reload the file and try again. Exhume AWP. If the file is so damaged that AWP File Doctor cannot repair it, then Exhume AWP should be tried. Exhume AWP restores the AWP file by searching for text characters. The restored file contains all characters in the text character range. Thus text characters that are not part of the original text will be included (frequently an additional character at the beginning and end of a text line). Non-text characters are replaced with an asterisk. If the number of characters exceeds 79 only one line of asterisks is added. The repaired file has the suffix ".E" added to the file name. The exhumed file when loaded into AWKS must be edited to remove spurious characters and add any text that may have been corrupted. This is the hard part of the repair, but usually not as hard as having to rewrite the whole file from scratch. It is suggested that a damaged AWP file be processed by both the AWP File Doctor and Exhume AWP. The former will reconstruct almost all of the file in a form requiring virtually no revision. The latter may extract a few more words of value. Restore ADB If an AppleWorks Data Base (ADB) file is corrupted, the file can be restored with Restore ADB. Damage can occur within a category, to individual records or to the header. Damage limited to within a category is flagged with an asterisk. If one or more categories have been damaged, the entire record (or contiguous records) cannot be restored and the first category in the record(s) is flagged with the message '** DAMAGED RECORD(S) **'. When this message occurs as the first record, a report record may actually have been damaged. If the file header is damaged, a standard header is substituted, which contains 30 categories. Category names may or may not be restored depending on whether the names were damaged. Report formats will be lost and have to be reentered. Occasionally, if the file still cannot be loaded into AWKS after processing with Restore ADB, the file may still be restored by forcing the standard header. This can be done by pressing the Closed Apple (Option) key when the ADB file is selected. Except for the first category, which will be titled 'CategoryÊ1', all the remaining category names will be hyphens. ______________________________________________________________________ NOTE: AWP File Doctor, Exhume AWP and Restore ADB will restore files with bad blocks. The message '** BAD BLOCK **' is inserted when a bad block is encountered. These utilities cannot repair a file if the volume directory or subdirectory are damaged (and sometimes the file index blocks pointing to the data blocks in the file). If one of the directories is damaged, I suggest using the ProSel utility, Mr. Fixit or my new utility, RESURRECTION. If you have a file that cannot be restored and the various directories are intact, please send it to me so that I can improve the algorithms used in the AWKS and ADB repair utilities. Copy the disk on which the file exists using a nibble copying utility such as Copy II+ and send the copy, not the original. Occasionally, when several blocks have been damaged, AWP File Doctor will produce a new file that cannot be loaded into AWKs. Try using AWP File Doctor again on the new file. This will usually restore the file. If not, use Exhume AWP. ______________________________________________________________________ View file. This utility will read any file with word-wrap. It works best with text files. Control characters are presented in uppercase inverse. If the file is an AppleWorks word processor (AWP) file (AW 3.0 and lower versions), it will automatically read it properly. This allows you to rapidly review TXT or AWP files in order to determine if you wish to use or convert them. View no longer scrolls. Reading the scrolling screen has always been a problem for the handicapped, and an impossibility for those who use an accelerator chip. The spacebar allows you to step through the file twenty-one lines (one screen) at a time. The RETURN key aborts the file. Any other key allows line by line step through. The left margin is automatically set for AWP files. For convenience, the file may be output to a printer. The printer output is set to slot 1. If you use a different slot, then change the low nibble of byte $04 (C1) to the slot number. This is most easily accomplished using a block editing utility such as ProSel Block Warden. Alternately the following patch will suffice after setting the prefix to the directory containing CHANGE.FILE. POKE 768,19n (where n = slot number + 2) BSAVE CHANGE.FILE,TSYS,A$300,L1,B4 Change file info. Any file type can be altered. You are responsible for the alteration. No checking is done. Following selection of the file(s), the previous file type is presented at the cursor and can be accepted as the default by pressing RETURN. Alteration can be accomplished using the designated file type abbreviations displayed (e.g. BIN, TXT). Or, if the abbreviation is not listed, by entering the hexadecimal code (e.g. $04, $06). After the file type code is accepted, the auxiliary type code is presented and can be altered by entering the appropriate code at the cursor. When the auxiliary type code is governed by the file type code (e.g. SYS always loads at $2000), the appropriate default can be accepted by pressing RETURN or the mouse button. The file access code can then be altered. The file can be toggled locked or unlocked, or each of the recognized bits in the byte can be separately toggled. The bits are 7 (Destroy-enable), 6 (ReName-enable), 5 (BacKUp-needed), 2 (INVisibility, GS/OS only), 1 (WRiTe enable), 0 (ReaD-enable). If the bit is set (1), then the bit is enabled. If cleared (0), then the bit is disabled. If bits DES,RN and WRT (7,6,1) are all set, then the file is considered unlocked. If any of these bits are cleared then the file is considered locked. The right and left arrows and the mouse move the cursor. The spacebar toggles whether the file is locked or not as well as the individual bits. The RETURN key or the mouse button accepts the displayed values. NOTE: The changes in this section are not written to the file until the final RETURN. ESCape always sends you back to the main menu. Line feed stripper. This utility strips line feeds that follow a carriage return. Only text files are accepted. The original file is preserved. For those wishing to read from the UNIX system, press the Open-Apple as well as the return key at the informational screen. This will convert all line feeds to carriage returns. The altered file is designated with an ".L" suffix. Strip control character. A specific control character or all control characters can be removed. If the specified control character is 'M' (e.i. carriage return), then a space is substituted for the carriage return. The control character strippers designate the altered file with the ".C" suffix. Insert line feed after carriage return. Some users apparently wish to communicate with Big Blue machines. This utility inserts a line feed after each carriage return in a text file, which is required by IBM and IBM compatible computers. The altered file is designated with an ".I" suffix. When converting files or stripping a control character with only one disk drive, the source and destination volumes must be the same. Icons CF.RES.ICONS contains Change-A-File and Resurrection icons. The Change-A-File icon is courtesy of Karl Bunker. To use these icons in the Finder, place CF.RES.ICONS in the ICONS subdirectory of the boot volume (BOOT.VOLUME/ICONS/CF.RES.ICONS) and reboot. The two programs must have file names of CHANGE.FILE and RESURRECTION. Suggestions, bugs and other trivia to: Compuserve [75156,2436] GEnie [H.PORTNOY] All rights reserved. AppleWorks, copyright Claris Corporation ProSel, copyright Glen Bredon Copy II+, copyright Central Point Software, Inc. Recent version updates: 3.00- Correct minor bug in directory input. 3.01- Correct bug in filetype listing when over 66 files. 3.02- Minor improvement. 3.03- Correct bug in Restore ABD File. 3.05- Correct bugs in directory selector. 4.0 - Major revision in format. 4.01- Correction of bug when used on IIC's. 4.02- Correction of bug in control character stripper. 4.03- Correction of bug in TXT to AWP. 4.04- Correction of bug in TXT to AWP and printer output. 4.05- Controlled scroll and word-wrap in View plus other minor impovements. 4.06- Some minor bug corrections and changes. 4.1 - Improved recovery of ADB report formats. 4.11- Bug fix in Strip Control Character. 4.12- Password works correctly with Resurrection 2.7. 4.14- Improved password use. 4.15- Minor bug fix in ProDOS input. 4.16- Bug fix in Repair ADB 4.17- Bug fix in Change File Info