@ECHO OFF CLS IF "%1" == "" GOTO BLANK IF NOT "%1" == "" GOTO SORTTXT :BLANK @ECHO. @ECHO * * * * * * * * * * * * * * * * * * * @ECHO * Q U I C K - S O R T B A T C H * @ECHO * * * * * * * * * * * * * * * * * * * @ECHO. @ECHO Copyright (C) 2002-2003 by Michael L. White. All rights reserved. See the @ECHO redistribution requirements listed at the end of this display. Original @ECHO release date: 21 December 2002. Update for post-Win9x versions release @ECHO date: 19 September 2003. @ECHO. @ECHO. @ECHO You did not type in a file path. You must execute this batch file from @ECHO either the DOS prompt or the Run dialog on the Windows Start menu. See @ECHO directions below. @ECHO. @ECHO. @ECHO DIRECTIONS: @ECHO. @ECHO 1. Type or copy and paste the list you want sorted into a new file, @ECHO making sure each item to be sorted is on a separate line, and save @ECHO the file. Quick Sort will place numbers in numerical order, too, so @ECHO keep that in mind if your list contains arabic numerals. @ECHO 2. Press the Start button, Windows Start key, or CTRL+ESC together. @ECHO. @ECHO. PAUSE CLS @ECHO. @ECHO 3. Select Run from the Start menu. @ECHO 4. Type in C:\QKSORT.BAT (or whatever the path is where you stored @ECHO QKSORT.BAT; letter case does not matter), then type a blank space, @ECHO followed by the path for the file you want to sort, another blank @ECHO space, and finally the path for the destination file where you @ECHO want your results to be saved. @ECHO 5. At either the DOS prompt or in the Run dialog, follow the example @ECHO below using the name by which you chose to save your file earlier. @ECHO. @ECHO. @ECHO EXAMPLE: c:\qksort.bat c:\sample.txt c:\sample2.txt @ECHO. @ECHO. @ECHO Note that the destination file has a different name. While Quick-Sort @ECHO will append your sorted results to the end of your source file, you are @ECHO wise to save them to a new file to avoid source file alteration. You @ECHO should also limit your filename to eight characters or less to @ECHO accommodate DOS file naming restrictions. @ECHO. @ECHO. @ECHO. set /p option=For handier reference, would you like to print the entire contents of this batch file? Type Y or N and press ENTER now. (Y=Yes N=No) CLS @ECHO. IF "%option%"=="N" GOTO CLOSE IF "%option%"=="n" GOTO CLOSE IF "%option%"=="" GOTO CLOSE IF NOT EXIST C:\QKSORT.BAT COPY QKSORT.BAT C:\QKSORT.BAT PRINT /D:PRN C:\QKSORT.BAT DEL C:\QKSORT.BAT :CLOSE @ECHO. @ECHO If you chose to print this file, you may need to press the sheet feed @ECHO button when printing is complete to eject the final page from your @ECHO printer. If the print option failed, you can edit this file using @ECHO a plain text editor such as Windows Notepad and print it from there. @ECHO. @ECHO. @ECHO Please press ALT+F4 together to close this window ... @ECHO. @ECHO. @ECHO Copyright (C) 2002-2003 by Michael L. White. All rights reserved. See the @ECHO redistribution requirements listed below. Original release date: @ECHO 21 December 2002. Update for post-Win9x versions release date: @ECHO 19 September 2003. @ECHO. @ECHO. @ECHO REDISTRIBUTION REQUIREMENTS: @ECHO This file may be freely distributed PROVIDED it is unaltered from its @ECHO present state and the copyright notice and this notice are included on @ECHO each copy, and PROVIDED FURTHER that no charge is made for its @ECHO redistribution. Contact the author, Michael L. White, by email at @ECHO info@parsonplace.com for permission to use Quick Sort in any way other @ECHO than what is prescribed in this notice. Visit Parson Place on the Web @ECHO at http://www.parsonplace.com for more great software! @ECHO. PAUSE GOTO END :SORTTXT SORT < "%1" >> "%2" @ECHO. IF "%2" == "" GOTO DESTFILE IF NOT "%2" == "" GOTO FINISH :DESTFILE @ECHO Sorting is complete... Open your sorted file at: @ECHO "%1" GOTO CLOSE :FINISH @ECHO Sorting is complete... Open your sorted file at: @ECHO "%2" GOTO CLOSE :END