home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 24 / CD_ASCQ_24_0995.iso / vrac / cols14.zip / COLS.BAT < prev    next >
DOS Batch File  |  1995-06-21  |  4KB  |  115 lines

  1. @ECHO OFF
  2. CLS
  3. ECHO.
  4. ECHO                TEXT COLUMN INTERCHANGE PROGRAM
  5. ECHO                            COLS.BAT
  6. ECHO                 COPYRIGHT (C) 1995 CHUCK BERNT
  7. ECHO                       ALL RIGHTS RESERVED
  8. ECHO.
  9.  
  10. REM  This batch program determines if the user is using
  11. REM  the short form or long form.  If the user is using the
  12. REM  short form, this program creates the script LAST.INP and
  13. REM  redirects that script into the QBASIC program.  This
  14. REM  script is identical to the key strokes that a user would
  15. REM  use in the long form.  If the user is using the long
  16. REM  form, then the program starts the long form.
  17. REM
  18. REM  This file (as sent originally) has the short form defaults
  19. REM  set to work with what is believed to be its' most likely 
  20. REM  use and is compatible with the original fun files.  If
  21. REM  another set of defaults is desired, then just make the
  22. REM  desired changes in the defaults indicated below; but I
  23. REM  would like to suggest that you make a copy of this file
  24. REM  and change its' name slightly to indicate the new defaults.
  25. REM  Then make the changes to that new file.  Then copy or
  26. REM  move that file to your path directory that contains the
  27. REM  original COLS.BAT.  Then when you need the new defaults,
  28. REM  type the new filename on the command line.  If you run
  29. REM  long files or would like to speed up the processing,
  30. REM  specify a carriage return instead of y to the totals
  31. REM  option (processing speed can nearly double).  A carriage
  32. REM  return may be specified by typing ECHO.>> \COLS\LAST.INP
  33.  
  34. BREAK ON
  35.  
  36. IF "%1" == "L" GOTO LAST
  37. IF "%1" == "LAST" GOTO LAST
  38. IF "%1" == "l" GOTO LAST
  39. IF "%1" == "last" GOTO LAST
  40.  
  41. IF NOT %2%%Z == %%Z IF EXIST %1.TXT GOTO LINE
  42.  
  43. ECHO.
  44. ECHO                ***  COMMAND LINE SHORT CUT  ***
  45. ECHO.
  46. ECHO   SYNTAX:COLS filename outcol1 [outcol2] [outcol3] ... [outcol8]
  47. ECHO.
  48. ECHO                       SOME EXAMPLES
  49. ECHO.
  50. ECHO              COLS TEST1 1 2 3 TSUM C1+C2+C3
  51. ECHO              COLS TEST1 1 2 3 TAVE (C1+C2+C3)/3
  52. ECHO              COLS TEST1 1 TSQUARE C1^2 tbig-one c1^c1
  53. ECHO              COLS TEST1 1 2^C1
  54. ECHO.
  55. ECHO  Some restrictions apply to the command line short cut that do not
  56. ECHO  apply to the longer method that you are about to follow.  Please
  57. ECHO  see the very short README.TXT.  The longer method will explain each
  58. ECHO  step -- so please continue.
  59. ECHO.
  60.  
  61.  
  62. PAUSE
  63.  
  64. COPY \COLS\COLSTATU.BAS \COLS\TXTTMP.BAS
  65. QBASIC /RUN \COLS\COLI
  66. DEL \COLS\TXTTMP.BAS
  67. GOTO THEEND
  68.  
  69. :LINE
  70.  
  71. ECHO.> \COLS\LAST.INP
  72.  
  73. REM  The next lines starting with an IF insert the output columns.
  74. IF NOT %2%%Z == %%Z ECHO %2 >> \COLS\LAST.INP
  75. IF NOT %3%%Z == %%Z ECHO %3 >> \COLS\LAST.INP
  76. IF NOT %4%%Z == %%Z ECHO %4 >> \COLS\LAST.INP
  77. IF NOT %5%%Z == %%Z ECHO %5 >> \COLS\LAST.INP
  78. IF NOT %6%%Z == %%Z ECHO %6 >> \COLS\LAST.INP
  79. IF NOT %7%%Z == %%Z ECHO %7 >> \COLS\LAST.INP
  80. IF NOT %8%%Z == %%Z ECHO %8 >> \COLS\LAST.INP
  81. IF NOT %9%%Z == %%Z ECHO %9 >> \COLS\LAST.INP
  82.  
  83. REM The next line ends the output column insertion.
  84. ECHO.>> \COLS\LAST.INP
  85.  
  86. REM  The next line inserts the filename.
  87. ECHO %1 >> \COLS\LAST.INP
  88.  
  89. REM  The next line specifies the delimiter (use c for comma).
  90. ECHO.>> \COLS\LAST.INP
  91.  
  92. REM  The next line specifies the number of input columns or
  93. REM  carriage return for no error checking.
  94. ECHO.>> \COLS\LAST.INP
  95.  
  96. REM  The next line specifies whether totaling will be done (y or no).
  97. ECHO y >> \COLS\LAST.INP
  98.  
  99.  
  100. :LAST
  101. COPY \COLS\COLLINE.BAS \COLS\TXTTMP.BAS
  102. QBASIC /RUN \COLS\COLI < \COLS\LAST.INP
  103. DEL \COLS\TXTTMP.BAS
  104.  
  105. ECHO ATTEMPTING to start YOUR editor (your file may be too large).
  106.  
  107. REM  The next line will automatically start the editor called
  108. REM  EDIT on the output file at the end of the short command
  109. REM  line form.  If you favorite editor has another name, please
  110. REM  change it below.
  111.  
  112. IF NOT %2%%Z == %%Z IF EXIST %1.TXT EDIT %1.LIS
  113.  
  114. :THEEND
  115.