"Einstein Monthly" Public Domain Software Column NSWP Tips - Part 2 NSWEEP, NSWP, NSWP205 or NS (for New Sweep) is a very popular file handling utility. The program is commonly used for the selective transfer of files from one disk to another using the "T" (Tag) and "M" (Mass copy) options. There are, however, some available features that are not explained in the menu, nor in the document file. In Part 1 we looked at the 'log on' procedure and the "Y" option. In this article we examine the use of wildcards. First of all, what is a wildcard? It is a character that represents all other characters; just like a wildcard in poker can be any card that the player chooses it to be. Wildcards can be used when you wish to perform an operation or set of operations on many similar files. Many programs require you to type in the name of a file at some point during their operation and many of them allow you to use wildcards to save a good deal of typing time. DIR, COPY.COM, PIP.COM, D.COM (the alphabetized directory program) and NSWP are a few examples of these types of programs. This article will explain how to use wildcards in general and how to apply them to the use of NSWP. The CP/M operating system (including Xtal.DOS) recognises two wildcard characters, "?" and "*". The question mark is a wildcard in exactly the same sense that a one-eyed jack is a wildcard: it represents a single character in a single position, but it can be any one of the characters available. Thus the filename CLOCK.?AS would match CLOCK.PAS, CLOCK.BAS and CLOCK.(any character here)AS. The asterisk character is a wildcard in a different sense because it can represent more than one character. You can roughly translate the asterisk in a filename as "and any other characters that follow", making it a shorthand form of the question mark wildcard. In other words you can do anything with a series of question marks that you can do with an asterisk, but with less convenience. Additionally, the asterisk wildcard applies only to the field it is in, meaning either the filename (the part before the period) or the extension (the part after the period). The following are some examples using NSWP as the program since it has several options that allow you to use wildcards, including the "F" (Find), "L" (Log), "R" (Rename) and "W" (Wildcard) options. We will assume that you have pressed the "W" key (for the wildcard option) and have received the prompt: Tag what? You can type responses as follows: Type W*.BAS This tags all the files beginning with W and ending with .BAS. Type W???????.BAS This does the same thing that W*.BAS does. Type *.BAK This tags all the files ending in .BAK wkich is useful for erasing WordStar backup files. Type WS.COM This tags the file WS.COM only, since there are no wildcards in the name. Type *.* EVERYTHING is tagged. Useful when copying or erasing entire disks. Type ????????.??? Does the same thing that *.* does. You can see that the asterisk is more convenient in this case Type LETTER.* This tags all files beginning with LETTER and ending with anything. Type LETTER.??? This does the same thing that LETTER.* does. If your Einstein has been fitted with a hard disk, at some time you will, undoubtedly, have wished to move files from one user area to another. The way you probably did this in the past was to copy the files from one user area to the other and then delete the files from the first user area. Besides requiring the extra step of erasing the files after the move, it takes a long time to copy the files, even with a hard disk. But as you will discover there is a better way. You can effectively move a file in NSWP by renaming it from one user area to another. This is possible because user areas are merely an illusion created by the operating system and the only difference between a file in one user area and the same file that has been moved to another user are is the first byte of the directory entry on the disk (which is the user area number or E5 hex if the file has been erased). What this means is that a file can be "moved" from one user area to another simply by changing the first byte of its directory entry. To use NSWP to accomplish this task, suppose you wanted to move the file FILENAME.EXT from user area 0 to user area 4. After using the "R" option to rename a file and assuming you are already logged onto user area 0, you would get a prompt like this: New name, or *? To move the file you could type either of the following responses: 4:FILENAME.EXT or A4:FILENAME.EXT In the time it takes to rename the file, which is considerably less than copying and deleting it, the file would be moved. But what if you have a large number of files to move? Wouldn't it be faster to tag the files you were interested in, mass copy them all to the new user area, retag, and delete them from the original user area than to rename them one at a time? This is true, but under certain circumstances you could take a renaming shortcut that is MUCH faster than copying the files. You access this shortcut by entering "*" as a filename after the rename prompt. This indicates that you wish to use wildcards in the renaming of the files, and another prompt will appear: Old name? You may then enter an ambiguous filename, like *.COM, which will allow you to rename (and therefore move) all the files that end with .COM. After entering the old name, another prompt will appear: New name? You may then enter the new filename for the files that are to be renamed. Note that you must enter an ambiguous new name if you entered an ambiguous old name, since it does not make any sense to rename all the files that end in .COM to one filename. Here is an example. Let us say that you wanted to move all the files from user area 1 to user area 13. The process would go something like this, with the things that you type enclosed in quotes: "R" New name, or *? "*" Old name? "*.*" New name? "13:*.*" That's all there is to it. You can use this feature whenever it is practical to use wildcards to describe the filenames, since renaming does not work on tagged files, and whenever you are moving files from one user area to another on the same disk drive (the only way to move files from one disk to another is to copy them). One final observation on the use of wildcards under Xtal DOS. The facility can be used in addition to NSWP as follows: (a) At the DOS prompt type COPY and when the asterisk appears type 0:*.* to 1: (to copy files from disk 0 to disk 1). Each of the files on disk 0 will appear in turn. Reply Y or N to copy. (b) At the DOS prompt type ERA *.* .Reply Y or N to erase files Jim Ellacott U.K.E.U.G. ÿ¼BF !)19AIQYaiqyÍ. Ãþ¯2|2\ÍÝ$.:&UNRV2#•!TRFC7l}-VERRMSU*WIDWRNmÁ#SETLIM¯ƒ+TRFC8æ®)TRNNNYY