home *** CD-ROM | disk | FTP | other *** search
/ SDN¹ Plus / SDN1_.cdr / sdn / util1 / gsr151.sdn / GSR.DOC next >
Text File  |  1991-08-26  |  16KB  |  419 lines

  1.  
  2.  
  3.  
  4.                   GGGGGGGGGG      SSSSSSSSSS       RRRRRRRRR    tm
  5.                   G        G      S                R        R
  6.                   G               S                R        R
  7.                   G               S                R        R
  8.                   G               SSSSSSSSSS       RRRRRRRRR
  9.                   G      GGG               S       R     R
  10.                   G        G               S       R      R
  11.                   G        G               S       R       R
  12.                   GGGGGGGGGG      SSSSSSSSSS       R        R
  13.  
  14.  
  15.  
  16.                     Global          Search          Replace
  17.  
  18.                                  Version 1.51
  19.  
  20.                            The Programmers Scalpel!  tm
  21.  
  22.  
  23.             Copyright 1990:1991 Phil Barnett. All Rights Reserved
  24.  
  25.  
  26.             GSR and all of its' associated files are Shareware.
  27.      'The Programmers Scalpel' and 'GSR' are trademarks of Phil Barnett
  28.  
  29. GSR is Copyrighted. Please feel free to give this program to anyone who uses
  30. a DOS based computer as long as it is distributed in unmodified and complete
  31. form. It should work on any close clone. I developed it in DOS 3.3
  32. It is compiled in Clipper 5.01. with MS-C6.0 subroutines for speed. It
  33. requires DOS version 3.0 or later.
  34.  
  35.  
  36.                  You may use GSR for 2 weeks at no charge. 
  37.  
  38.              Then if you wish to continue using GSR, you must 
  39.  
  40.                    PAY ME FOR IT    or    STOP USING IT.
  41.  
  42.  
  43. Registration fee is $20.00. I prefer to trust you, so no protection is
  44. involved. This is an absolutely complete version. Even if you don't use it,
  45. please feel free to distribute it in unmodified form.
  46.  
  47.                  ****************************************
  48.                  *   Phil Barnett      (407) 884-5192   *
  49.                  *   1105 Binion                        *
  50.                  *   Apopka, Fl 32703                   *
  51.                  ****************************************
  52.  
  53.  
  54. When you register GSR, I will mail you the latest version which will have
  55. the registration notices removed from the program.
  56.  
  57. The latest unregistered version is always available at:
  58.  
  59.  ╒════════════════════════════════════════════════════════════════════════════╕
  60.  │          Login to the Orlando Bullet, and register as a user.              │
  61.  │                                                                            │
  62.  │   Orlando Bullet  (407) 277-2007  1200-9600 HST Dual Standard. 24 Hours.   │
  63.  │                                                                            │
  64.  │ The Orlando Bullet is dedicated to Clipper programmers all over the world  │
  65.  │                                                                            │
  66.  │                            *** Please Note ***                             │
  67.  │                                                                            │
  68.  │  Due to heavy usage, new users are only allowed logon priveliges           │
  69.  │                                                                            │
  70.  │  from Monday morning to Friday night. Thank You.                           │
  71.  ╘════════════════════════════════════════════════════════════════════════════╛
  72.  
  73.                ***** An Important Note about Shareware *****
  74.  
  75. SOAPBOX MODE ON:
  76.  
  77. The concept of shareware is this: Try the software "Free of Charge" for a trial
  78. period. Use it "For Free" to find out if it suits your purposes, or saves you
  79. time, or makes difficult things easier, or saves you money, or just plain does
  80. something you want to do. After you have determined that a shareware program
  81. suits your purposes, and you continue to use it beyond its' trial period, you
  82. must buy it. Not doing so constitutes theft of services.
  83.  
  84. If you use this program, you should register it. Consider this. I spent many
  85. hours writing and perfecting this utility. If I spent only 50 hours, (which I
  86. spent considerably more than) I would be working for you for only 40 cents an
  87. hour. This doesn't include the marketing expenses and long distance charges 
  88. I spent on distribution services. It is neither easy nor inexpensive to
  89. develop good quality software. If you continue to use any shareware program,
  90. you should BUY it.
  91.  
  92. I have written much shareware software, and found that only 1 in a thousand
  93. users of a shareware program ever bother to register it. Amazingly enough,
  94. European, Canadian, and Australian users have taken the trouble, time, and 
  95. expense to register my shareware with me at a much higher rate than my 
  96. U.S. users. This amazes me. In the U.S., we have one of the highest
  97. standards of living in the World, and yet are apparantly more willing to
  98. steal shareware than users in less fortunate countries.
  99.  
  100. The good part of registering is this. If you register your shareware, you will
  101. have opened the lines of communication for added improvements, and enabled 
  102. other fine shareware to be written. I listen to my registered users, and make
  103. every attempt to adhere to their criticism and comments for useful changes.
  104.  
  105. The sad part may be this. Eventually, unrewarded authors will no longer write 
  106. useful programs for you to try before you buy. Shareware will die. You will be
  107. the loser.
  108.  
  109. Remember, every time you see the opening screens of an unregistered shareware 
  110. program, you are being reminded that you are part of the 999 in a 1000.
  111.  
  112. If you already register the shareware you use, I congratulate you. You are one
  113. of a rare and honest breed. All shareware authors thank you.
  114.  
  115. Judge yourself. Do you register your often used shareware programs?
  116.  
  117. And now, on to better things.....
  118.  
  119. SOAPBOX MODE OFF:
  120.  
  121.  
  122.                       INSTALLATION INSTRUCTIONS
  123.  
  124.  
  125. You may place GSR in any directory, however it is easier to use if you
  126. place it in a directory which is in the path statement of your autoexec.bat.
  127.  
  128.  
  129. GSR includes four files.
  130.  
  131. 1      GSR.EXE        The Executable Program
  132. 2      GSRAVOID.DBF   A table of special extensions (explained below)
  133. 3      GSR.DOC        This Document
  134. 4      GSR.SDA        The SDN short form document.
  135.  
  136.  
  137.  
  138.              !!!!!!!!!! IMPORTANT !!!!!!!!!!! READ THIS !!!!!!!!!!
  139.  
  140.       YOU SHOULD ALWAYS MAKE A BACKUP OF THE DIRECTORY YOU ARE WORKING IN 
  141.                           BEFORE YOU BEGIN WITH GSR.
  142.  
  143.       YOU SHOULD ALWAYS MAKE A BACKUP OF THE DIRECTORY YOU ARE WORKING IN 
  144.                           BEFORE YOU BEGIN WITH GSR.
  145.  
  146.       YOU SHOULD ALWAYS MAKE A BACKUP OF THE DIRECTORY YOU ARE WORKING IN
  147.                           BEFORE YOU BEGIN WITH GSR.
  148.  
  149.    Even though every precaution has been taken to insure it's safe use, the
  150.   potential for unrecoverable change exists in any program with this kind of
  151.     power. GSR even keeps the last 99 versions of what you are working on.
  152.  
  153.  
  154.  
  155.  !!!!!!!!!!!!!!!!!!!!!!!!! ALWAYS make a backup first !!!!!!!!!!!!!!!!!!!!!!!!!
  156.  
  157.                           Manual for GSR Version 1.51
  158.  
  159. GSR is a Global Search and Replace program. It allows you to select a group
  160. of files to operate on. You can then specify what text to look for, and what
  161. text to replace it with. Your search can be either case sensitive or not,
  162. and you may either view each occurance, to verify the change, or have GSR
  163. automatically make all replacements for you.
  164.  
  165. Version 1.51 now has Virtual file handling capabilities. This means GSR can
  166. run in less memory, and handle unlimited files sizes.(based on disk space)
  167.  
  168. GSR will now run in monochrome. Type GSR M at the command line.
  169.  
  170. Probable uses are:
  171.  
  172. Rename an existing variable across many programs.
  173. Change a copyright notice.
  174. Change a client name when you are recycling code.
  175. and many more.....
  176.  
  177. All options are entered into blanks after you run the program.
  178.  
  179. You may press <Esc> at any time, to stop the process. The file you are
  180. operating on at the time will remain unchanged. Files you have already
  181. confirmed changes on will remain changed.
  182.  
  183. When you see the field labeled "File Spec to Include" you should enter the
  184. type of file you wish to perform global operations on. Typical response might
  185. be;
  186.  
  187. *.C
  188. *.PRG
  189. *.BAT
  190. *.BAS
  191. *.TXT
  192. XXX*.XXX
  193. and etc.
  194.  
  195. The next field you enter is 'String to Search for'. This is where
  196. you enter the text you are wishing to replace. If you need to replace text
  197. that is longer than 76 characters, or you wish to include carriage return
  198. linefeed combinations, you may use an input file instead. Place the filename
  199. in <> like this: <lookfor.txt> as the only item in the field.
  200.  
  201. (you can use any filename here, lookfor.txt is only an example)
  202.  
  203. The next field you enter is 'String to Replace with'. This is the
  204. text you wish to replace the above field with. You may also use an input file
  205. here by placing the replacement text in a file and specifying it's name
  206. in <> like this: <a:\repwith.txt> as the only item in the field.
  207.  
  208. (you can use any filename here, a:\repwith.txt is only an example)
  209.  
  210. Your next option is '(M)anual or (A)utomatic'. If you select automatic mode,
  211. the search and replace operation will complete without further intervention.
  212. If you are unsure of the consequences of this action at all, you should use
  213. manual mode instead. Manual mode will present you with each occurance
  214. surrounded by its contextual suroundings. You can decide what to do with
  215. each occurance individually.
  216.  
  217. Your last option is to make GSR search for your text regardless of the case.
  218. If you choose 'Case Sensitive' = 'N', capitalization will have no bearing on
  219. your search.
  220.  
  221. pHiL will find PHIL
  222. xxxxxx will find XXXXXX
  223. PHIL will find phil
  224. copyright 1990 will find Copyright 1990
  225. and etc.
  226.  
  227.  
  228. After you have entered the five primary fields, you will be presented with
  229. a summary screen of selections. This will allow you to review your choices
  230. and abort the process if you were mistaken in any way.
  231.  
  232. When you confirm the selections you have made, the search will begin.
  233.  
  234. If you selected manual mode, each occurance of the searched for text will be
  235. displayed in context as it is found. You will be asked:
  236.  
  237. Replace this occurrance?  (Y/N)
  238.  
  239. If you select Y, it will be replaced, and the search will continue. If you
  240. select N, the search will continue with no changes to the file.
  241.  
  242. When you have reached the end of the file, and you have previously selected to
  243. replace an occurrance, you will receive one final prompt:
  244.  
  245. Make Changes to FILENAME.EXT Permanent?
  246.  
  247.    CONFIRM        ABORT
  248.  
  249. If you select CONFIRM, your changes will be written. If you select ABORT,
  250. any changes you have already selected on this file will be ignored.
  251.  
  252. In any case, if you choose to make the replacements, your original text will
  253. be renamed with the extension .GSR. Subsequent changes will increment the .GSR
  254. extension, with up to 99 changes kept on any single file name.
  255.  
  256. MYTEXT.GSR
  257. MYTEXT.GS1
  258. MYTEXT.GS2
  259. MYTEXT.GS3
  260. MYTEXT.GS4
  261. MYTEXT.GS5
  262. MYTEXT.GS6
  263. MYTEXT.GS7
  264. MYTEXT.GS8
  265. MYTEXT.GS9
  266. MYTEXT.G10
  267. MYTEXT.G11
  268. MYTEXT.G12
  269. MYTEXT.G13
  270. MYTEXT.G14
  271. MYTEXT.G15
  272.  
  273. up to 
  274.  
  275. MYTEXT.G99
  276.  
  277. 99 previous versions are kept until you choose to delete them. This is going
  278. to create a lot of backups, but is necessary due to the tremendous power of 
  279. this program to cross all safety barriers.
  280.  
  281. This process repeats for every file in the selected group.
  282.  
  283. During the replacement process you are informed of your location in the group
  284. of files you are operating on. When you have finished, you are presented with
  285. statistics informing you how many replacements were made and in how many files.
  286.  
  287.  
  288. ************************
  289. * Snow on CGA displays *
  290. ************************
  291.  
  292. If you are experiencing snow or flashing dots on the screen, place the
  293. following line in your AUTOEXEC.BAT
  294.  
  295. SET CLIPPER=S1
  296.  
  297. This will stop the snow from appearing on your CGA display.
  298.  
  299.  
  300.  
  301.                                   GSRAVOID
  302.  
  303. WHY IT'S HERE:
  304.  
  305. There are many types of files that any length text can be replaced with any
  306. other length, and never cause a problem.
  307.  
  308. There are other files, however, that allowing a change like this would cause
  309. a disaster. For this reason, I included fifteen file extensions inside GSR
  310. that cannot be written to unless the search text and the replace text are
  311. identical in length. (You may override these names)
  312.  
  313. GSR looks for the file GSRAVOID.DBF in the current directory, and if it finds
  314. it, GSR reads in the file extensions in GSRAVOID instead of using it's 
  315. internal list.
  316.  
  317.   This means: If you need to override the default values, you need to modify
  318.               GSRAVOID.DBF and put it in the directory where you are working.
  319.  
  320. This allows you to add to or override my fifteen extensions.
  321.  
  322. The extensions I avoid internally are as follows.
  323.  
  324. .COM       .EXE       .DBF       .DBT       .NTX       .NDX       .PAK
  325. .OVL       .LIB       .OBJ       .MEM       .SYS       .ZIP       .ARC
  326. .IDX
  327.  
  328. (you may override any or all of them.)(or add to them)
  329.  
  330. Changing the length of any of these types of files would spell certain 
  331. disaster. You may add more if you wish by filling in more records in
  332. GSRAVOID.DBF with any dBASE type program. You do NOT need to put GSRAVOID.DBF
  333. in a directory for GSR to work. It only exists so you can override my defaults.
  334.  
  335.  
  336.  
  337. WARNING!
  338.  
  339. DISCLAIMER:
  340.  
  341. You are totally responsible for the use of this program. If it causes damage
  342. of any kind, you are responsible. In no way will I, Phil Barnett, assume any
  343. expense or provide any compensation for the use or misuse of this program.
  344.  
  345. YOU SHOULD ALWAYS MAKE A BACKUP OF THE DIRECTORY YOU ARE WORKING IN
  346. BEFORE YOU BEGIN WITH GSR. 
  347.  
  348. GSR is a tool, nothing more. It can be used in a damaging way as easily as
  349. a beneficial way. I hope you find it of benefit to you. I wished for a program
  350. like this for a long time, and after giving up hope of finding it, I finally
  351. wrote it myself. I use it constantly, and wish I'd had it years ago. 
  352.  
  353. Good Luck, Good Programming, and God Bless You.
  354.  
  355. My motto:    Easier is Better!
  356.  
  357. MODIFICATONS HISTORY
  358.  
  359. Version 1.51 Retains latest filespec when returning to main screen.
  360.  
  361. Version 1.5 removed .BAT from avoidance list. Added .IDX
  362.             Allowed users to remove snow from older CGA displays.
  363.             Program now returns to main screen when a run is finished.
  364.  
  365. Version 1.4 update added a virtual file manager, making it possible to use GSR
  366.             on ANY size of file. 
  367.  
  368.             1.4 no longer copies the original file to the backup name.
  369.             The original file is now RENAMED to the backup name.
  370.             (much safer)
  371.             
  372.             added monochrome switch on the command line -> GSR M for
  373.             monochrome...
  374.  
  375.  
  376. Version 1.3 is the first Shareware version.
  377.  
  378.             added ability to specify 'use files' on disk to fill the search
  379.             and replace parameters.
  380.             
  381.             added case sensitivity.
  382.             
  383.  
  384. Version 1.2 was the Gamma version
  385.  
  386.             added the c routine that allows rapid context viewing allowing
  387.             the new user interface to emulate the Norton Text Search (TS.EXE)
  388.             look and feel. 
  389.             
  390.             added manual refusal on changes.
  391.  
  392.  
  393. Version 1.1 was the Beta version.
  394.  
  395. Version 1.0 was my original creation, a diamond in the rough. 
  396.  
  397.  
  398. CREDITS:
  399.  
  400. Thanks to the generosity of Rusty Justin for making this creation necessary.
  401. (I mean it. Thanks, Rusty!)
  402.  
  403. Nortons Text Search (TS.EXE) is a copyrighted and trademarked program by 
  404. Peter Norton Computing.
  405.  
  406. I must admit, that I always wished and waited for Peter Norton to upgrade his
  407. TS.EXE program to do what GSR.EXE does. When Peter Norton Computing was 
  408. purchased by another company (Symantec), the 5.0 version was released. TS.EXE
  409. was no longer offered as a utility in the 5.0 Advanced Version. By this time,
  410. I knew I would never see Peter Norton Computing create the program I had wished
  411. for. I proceeded to create it.
  412.  
  413. This version is written in Clipper 5.01, and undoubtedly, as I learn more about
  414. the C language, I will convert this utility to the speed, size, and portability
  415. of C. Until then, this one works excellently, and I do not feel compelled to
  416. rush into it's re-creation in another language. If anyone out there wants to
  417. rewrite this utility in C, I would appreciate owning a copy of the final
  418. product. Clipper is not particularly slow, however, it is rather bulky.
  419.