/* $Revision Header *** Header built automatically - do not edit! *********** * * (C) Copyright 1992 by Metalworx * * Name .....: wfile.hlp * Created ..: Thu 12-Mar-92 20:51 * Revision .: 3 * * Date Author Comment * ========= ======== ==================== * 19-Oct-92 Mtwx documented -l option * added warning at -c option * 16-Sep-92 Mtwx changes due to release of v1.31 * 20-Apr-92 Mtwx -s option documented * 12-Mar-92 Mtwx Created this file! * * $Revision Header ********************************************************/ #define REVISION 3 WFile - WorkFile - work (do things) on (ASCII-)files ---------------------------------------------------- Version 1.32 - Freely distributable as long as it is not used in commercial products. WFile takes one (1 in the current version, more in later versions) file and processes certain characters in it. Tabs can be expanded to multiple spaces, multiple spaces can be shrinked into one tab. Newline characters can be expanded by a CR code (usual on MS-DOS machines) or MS-DOS file-newlines can be stripped to a single LF code (usual on Amiga and UNIX machines). Foreign characters (German Umlaute for example) can be changed to the character set of another machine. WFile provides a number of built-in templates to adapt files between AmigaDOS, MS-DOS (& OS/2) and UNIX machines. This allows the user to adapt a file quickly without knowing the different ASCII-codes on each system. Type 'wfile' without any parameters to see how to invoke WFile. Parameters in <> brackets have to be specified, those in [] brackets are optional. Parameters divided by a | can be replaced by each other, i.e. one of those parameters have to be specified. Here are some more facts concerning the parameters: file - name of the file to be processed. WFile automatically backs up the original file by adding the extension .bak to it. (The MS-DOS and OS/2 versions change a present extension to .bak.) You could switch back up off by setting the -b option (no backup). -? - displays this help text and exits. All other parameters are ignored. +|-CR - adds (+) or removes (-) the CR character ($0d) before a LF character ($0a). In AmigaDOS and UNIX a newline is represented by a single LF character, on MS-DOS and OS/2 systems a newline is represented by a CR and a LF character. +|-T[tabsize] - +T shrinks multiple spaces (number can be specified by the optional tabsize parameter) to one tab. -T expands one tab to multiple spaces. If no tabsize parameter is given, a tabsize of 8 is assumed. WFile regards tabs as fixed tabs, that means that tabstops are set at fixed positions. Example: If you have a tabsize of 8 and the first two characters are two slashes (//) the next tab will advance the cursor to file position 8 (next tabstop) and not 10 (fileposition + tabsize). -ddd=ddd exchange characters With this option you can adapt foreign symbols (German Umlaute for example) from one system to another since there are different ASCII codes on each system. With -246=148 you can adapt the German oe on Amiga systems to an oe on MSDOS and OS/2 systems. You could also delete characters like an oe if you say -246=0. To exchange the ASCII value 246 against the ASCII value null (0) you have also to specify the -0 option (see below). -0 treat 0 as an ASCII value If you want to *EXCHANGE* something with a \0 rather than deleting a character you have to set the -0 option, otherwise the 0 would be treated as a remove command (see exchange characters above) -b do not create backup of the original. Usually WFile creates a backup of the original file to make sure that, in case of an error, you could restore the original state. The backup file gets the extension .bak. -f[filename] use a profile to enter commands. With this powerful option you can specify a file that contains WFile options. This allows you to keep all your desired options in a file so that you don't have to enter all the options every time you use WFile. If you don't specify a file name, WFile will look for the file "wfile.pro" to read. (see below how to build a profile) +ddd add character to end of file Some (strange) operating systems such as the famous operating system bulit in (curiously enough) very popular machines (starting with M..., I don't dare to speak out the name) add a $1A code to the end of each file. If you convert files from a real computer to one of those systems you can enforce to add this character with +26 (decimal value of $1A). You could, of course, add any other (ASCII) value between 0 and 255. -s set work buffer size With this option you can manually set the size of the work buffer. Usually this size is calculated automatically after scanning the input file. Therefore it may exceed the 64 KByte limit that restricts memory operation on Intel-processor-based systems. In these cases you may set the buffer manually to a value < 64 KByte. However you have to be *VERY CAREFUL*! If you specify a value that is too small, your machine may crash. You don't need to specify this value on AMIGAs or UNIX machines, because they don't have this silly 64 KByte limit. -c[[k]ddd] concatenate lines Using this option you could concatenate lines of text. This makes sense if you read in the wfile'd ASCII file into a word processing system that works with automatic line wrap (every word processor does that). It is especially useful if you are using proportional fonts in your word processor. If you specify a margin after the -c option, wfile will concatenate lines that are *LONGER* than the specified value. By default a margin of 60 characters per line will be used, i.e. if a newline character is at a position <= 61, the next line will *NOT* be concatenated to the actual line, if the newline occurs at a postion > 61 the next line will be appended to the actual line (the newline character will be replaced by a space character to keep words apart!). If you specify a 'k' directly after the -c and *BEFORE* the margin value, paragraphs will be preserved. That means that an empty line (a line with only a newline character) will *NOT* be appended to the actual line, no matter which value your concat margin has. This option however is just for simple cases. For larger texts or more specific indentation or concatenation use tools like ARoff or nroff. WARNING: This option only works correctly with single linefeed codes. To use this option with MSDOS or OS/2 based files first strip the CR codes using -CR, use -c... and finally add the CR codes again using +CR! -l delete empty lines Deletes empty lines (i.e. lines that only contain A SINGLE LINEFEED CHARACTER (!!)). In order to work with MSDOS or OS/2 based texts that use CRLF as the line seperator, first strip CR codes using -CR, use -l and finally add the CR codes again using +CR! TEMPLATES: ---------- Generally: All options within a template are displayed on STDOUT to let you see what's going on. -AI - Amiga to IBM This template changes foreign symbols (German Umlaute in the current version) from the Amiga to the enhanced IBM-ASCII set used in IBM PCs and its clones. It also adds an CR code to the end of each line. -IA - IBM to Amiga This templete changes foreign symbols (German Umlaute in the current version) from the enhanced IBM-ASCII set to MSDOS compatible systems to the character set of the Amiga. The CR code at the ende of each line will be stripped. -AU - Amiga to UNIX changes Amiga foreign symbols to their UNIX (HP 9000/825 HP-UX 7.0 SysV) equivalents (see above). -UA - UNIX to Amiga changes UNIX (HP 9000/825 HP-UX 7.0 SysV) foreign symbols to their Amiga equivalents (see above). -UI - UNIX to IBM. changes foreign symbols from UNIX to the enhanced IBM- ASCII set used in IBM PCs and its clones. It also adds an CR code to the end of each line. -IU - IBM to UNIX changes foreign symbols from the enhanced IBM-ASCII set on MSDOS compatible systems their equivalents in UNIX.The CR code at the end of each line will be stripped. -AO - Amiga to OS/2 almost the same as -AI, except that no end-of-file-character (0x1a) will be appended to the end of the file. -OA - OS/2 to Amiga almost the same as -IA, except that there is no silly end-of-file-character (0x1a) to strip off. PROFILES: --------- Generally: All options within a profile are displayed on STDOUT to let you see what's going on. In a profile you can specify the options that WFile should use. You can keep any number of profiles, according to your needs. If you want to use a profile you must specify the -f option (see above) to let WFile know your commands come from a file. If no filename after the -f option is specified, WFile looks for a file named 'wfile.pro' in the current directory to read from. Amiga users should keep their wfile.pro file in the s: directory and invoke WFile with -fs:wfile.pro option. A profile can contain any number of options as long as the general maximum for WFile commands is not exceeded. All templates (see above) may be used! In this case you should not specify the options within a template also on the command line. WFile might get confused if an option has to be processed twice. Each option must stand in a seperate line. Each line MUST NOT contain more than 79 characters (currently there is no option, that is that long). Each line MUST end with a newline character ($0a on UNIX and Amiga, $0d$0a on MSDOS). Comment lines MUST have a # character as their first sign. Example: # don't enter the literally, just press return -t2 -UI -b --------------------------------------------------------------------------- WFile is (C) Copyright 1991, 1992 by Joerg Fenin / Metalworx. USE THIS PROGRAM AT YOUR OWN RISK!! There is no guarantee that WFile works properly. The author takes no responsibility for any damage that might result from the use of WFile. This program may be distributed and used freely. No more than DM 5,- / US $ 5,- should be charged for copying. It MUST NOT be part of any commercial product without the written permission of the author. Send your enquiries, bug reports, cheques, cash or photos (girls only!) to this address: Joerg Fenin German speaking users should use the o-Umlaut! Zum Jaegerfeld 19 ... see previous line! 2100 Hamburg 90 Germany