Advertisement
Guest User

Untitled

a guest
Apr 11th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.54 KB | None | 0 0
  1. @echo off
  2.  
  3. Setlocal Enabledelayedexpansion
  4.  
  5. (
  6.   echo;854/FLammrock
  7.   echo;12/LOL
  8.   echo;259/Salut
  9.   echo;7458/Test
  10.   echo;125/Oui
  11.   echo;36/NANII
  12. )> myFile.txt
  13.  
  14. call :sort myFile.txt
  15.  
  16.  
  17. pause&exit
  18. :sort <File>
  19.   type nul > "%temp%\tempfile"
  20.   for /f "tokens=1,2 delims=/" %%a in ('type "%~1"') do (
  21.     set /a seq=1000000000+%%~a
  22.     echo;!seq!/%%b
  23.   )>>"%temp%\tempfile"
  24.   type nul > "%~1"
  25.   for /f "tokens=1,2 delims=/" %%a in ('sort "%temp%\tempfile"') do (
  26.     set /a seq=%%~a-1000000000
  27.     echo;!seq!/%%b
  28.   )>>"%~1"
  29. goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement