home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / 4dcat10.zip / SORTEM.BTM < prev   
Text File  |  1996-03-07  |  1KB  |  44 lines

  1. : The next two lines give the database format.
  2. : ..|....1....|....2....|....3....|....4....|
  3. : 7a arj.exe        122094  17-01-95  23:14
  4.  
  5. unset /q key1 key2 key3 /r ?
  6.  
  7. if %@index[%&,?] != -1 goto help
  8. if %@index[%&,/r] != -1 set order=/r
  9.  
  10. if %1==n set key1=/6:8
  11. if %1==s set key1=/19:7
  12. if %1==t set key1=/35:2 /32:2 /29:2 /39:5
  13. if %2==n set key2=/6:8
  14. if %2==s set key2=/19:7
  15. if %2==t set key2=/35:2 /32:2 /29:2 /39:5
  16. if %3==n set key3=/6:8
  17. if %3==s set key3=/19:7
  18. if %3==t set key3=/35:2 /32:2 /29:2 /39:5
  19.  
  20. : The t sort key depends on the date format. European format (dd-mm-yy) is
  21. : assumed here. Change key if other format is used.
  22.  
  23. : Explanation of the next line.
  24. : Look in column 6 for a space: don't use these lines. (All filenames start in
  25. : column 6.
  26. : Look in column 8 for any character (including space): do use these lines.
  27. : (Even the 'empty' lines have a CR/LF char in col 6/7)
  28. : Look in column 20 for DIR: don't use these lines.
  29. fgrep -sxvi6 ' ' database.txt|fgrep -sxi8 '?'|fgrep -sxvi20 'DIR'|rpsort/q %order %key1 %key2 %key3|list /s
  30. quit
  31.  
  32. :help
  33. echo.
  34. echo %@filename[%0] sorts the files in the database.   By Hans Tenkink
  35. echo.
  36. echo A sort key kan be added as a commandline parameter:
  37. echo %@name[%0] n sorts on filenames.
  38. echo %@name[%0] s sorts on filesize.
  39. echo %@name[%0] t sorts on date and time.
  40. echo a '/r' reverts the sort order.
  41. echo.
  42. echo Example: %@name[%0] t /r  Gives the most recent files first.
  43. echo.
  44.