[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Ignorant Keyboard Question



 from Morris Krok

 essence@xxxxxxxx

 My solution in overcoming Rene's "Ignorant Keyboard Question".

 (1) Save directory of each of my document files as a text docmument.
 (2) Edit these document files (it is much quicker than you would think) by
using search/replace on the command line and a few short programs that
eventually each directory will look like this: (incidentally some of my
directories have more than 100 files):
ca c:\xyfind\aboutme.txt
ca c:\xyfind\aboutyu.txt
ca c:\xyfiles\secret.txt
ca c:\xyfiles\advert.txt
 For the sake of this example I show files from two directories, but of
course it can contain files from a hundred directories.

 This is what calchng2.pm looks like. Actual file sent as an attachment.

«sv08,ECJRF»«lbloop»«prCall/Jchange/End/Readxit/Filename»«sx01,@upr(«rc»)»«s
x02,«is01»î«is08»»«if«pv02»==1»«glnext»
«ei»«if«pv02»==2»«glchange»
«ei»«if«pv02»==0»«glend»
«ei»«if«pv02»==3»«glredix»
«ei»«if«pv02»==4»«glhead»
«ei»«lbhead»«sx09,«va$fp»»TF CA «pv09»
CD CD CD BC saXC CH «glloop»
«lbnext»DL «sv06»YD AS BC «pv06»XC GT XP «glloop»
«lbredix»DL «sv06»YD AS BC «pv06»XC GT XP «glend»
«lbchange»BC abXC AS «glnext»
«lbend»AS BC abXC AS TF «prDone»«ex1»
{note that in case I am calling up a XyWrite program, the XP function is used so that it can be automatically viewed in the expanded format} This simple program written incidentally in Xy3 (have not tried it in Xy4 but see no reason why it should not work in it). For this program to work, call up the combined directory text file in the above format, load calchng2.pm a alt key or ldpm it temporarily on a key. Then with the cursor on the first line of the combined file, call up the program. You can of course go directly to a specific file and call it up immediately. Though you have five options ECJRF, you commence by pressing "C" to call up the file where the cursor is pointing. If "C" is not pressed, the program will not work. This brings the first file to the screen so as to give you an idea what it is about. If you press "F", it will insert the name of the file at its head. When a file is called up in this mode, it is merely to give you a bird's eye view of it. Should you wish to edit this particular file press "R". If your intention is to glance at the various files in sequence, press "J". When you press "J", it will clear the previous file and replace it with the one next in line. By pressing "E" the program terminates . The way I go about transforming a directory saved as a text file, is by first replacing one space with a full stop, then two spaces with a full stop, then three spaces with a full stop. This procedure plus a few other tricks condenses the line of each directory. We are then left with the file name and the size of the directory plus date. Providing the extensions of your files do not contain numbers, I use a search/replace feature to insert "#" in place of .0, .1, to .9 in turn. Then the search/replace command is used to replace the "return" character at end of each line with "^". I then use a small program that deletes whatever is between # and the ^ including these markers. The next thing is to add ca c:\name of directory to each file. This can be done with another small program. It will certainly be tedious if each line has to be amended manually. All of the above may seem very complex and sophisticated, but it is merely obeying a few simple rules and what is more it is great fun. I however, do not doubt it, that this entire procedure can be done more simply by a more advanced programmer. And the solutions that Carl and others have presented may be superior and simpler. For my purpose I find the features of this program, very useful. Calchng2.pm is attached as a separate file

CALCHNG2.PM
Description: Binary data