Windows is known to react badly to rapidly launching thousands of small processes -- some sort of table fills up faster than it can empty and processes start failing to launch -- so yeah, I can see my first version not working properly in Windows. In UNIX, it would work, but at suboptimal speed.
Here's the single-sort version rewritten without sed.
awk -v RS="" -v ORS="\n" -v OFS="\n" -F"\n" '{
$1=sprintf("%08d\t%s", ++Z, $1);
Z++; for(N=2; N<=NF; N++)
$N=sprintf("%08d\t%s", Z, $N) } 1' data |
sort | awk '{ sub(/^[^!#]*/, ""); sub(/^#/, "\n#"); } 1'
#awsekar
! aaosekar=.....
! aausekar=.....
! aousekar=.....
! auosekar=.....
! ausekar=......
! aushekar=.....
! avasekar=......
! avsekar=......
! awasekar=......
! awsekar=......
#ayaaj
! aayaj=....
! aayaz=....
! aiyaz=.....
! ayaaj=
! ayaaz=.......
! ayaj=.....
! ayaja=.....
! ayaz=.......
! ayaza=.....
! ayyaj=.......
! ayyaz=......
#ayeza
! aaeesa=....
! aaeesha=....
! aaesha=.....
! aaisa=....
! aaisha=....
! aayasa=....
! aayasha=....
! aayeesha=.....
! aayesha=....
! aayeshaa=....
! aayisha=.....
! aaysa=....
! aaysha=....
! aeesa=....
! aeesha=....
! aesha=.....
! aeysha=....
! aiesha=.....
! aisa=....
! aisha=....
! aiyasha=....
! aiyesha=....
! aiysha=....
! ayaesha=.....
! ayasa=....
! ayasha=....
! ayeesha=.....
! ayesha=....
! ayeshah=.....
! ayeshaha=....
! ayeza=....
! ayisha=.....
! aysa=....
! aysha=....
$
You could also use Busybox for Windows to fill out your missing system utilities. It's a single executable which bundles all of these:
[, [[, ar, ash, awk, base64, basename, bash, bbconfig, bunzip2, bzcat,
bzip2, cal, cat, catv, cksum, cmp, comm, cp, cpio, cut, date, dc, dd,
diff, dirname, dos2unix, echo, ed, egrep, env, expand, expr, false,
fgrep, find, fold, getopt, grep, gunzip, gzip, hd, head, hexdump, kill,
killall, length, ls, lzcat, lzma, lzop, lzopcat, md5sum, mkdir, mv, od,
pgrep, pidof, printenv, printf, ps, pwd, rm, rmdir, rpm2cpio, sed, seq,
sh, sha1sum, sha256sum, sha512sum, sleep, sort, split, strings, sum,
tac, tail, tar, tee, test, touch, tr, true, uncompress, unexpand, uniq,
unix2dos, unlzma, unlzop, unxz, unzip, usleep, uudecode, uuencode, vi,
wc, wget, which, whoami, xargs, xz, xzcat, yes, zcat
Particularly useful is the built-in shell, since it can run pipe chains properly, and will know how to use all the above commands without prepending 'busybox.exe ' to them.
Its built-in BASH is not actually BASH shell, just the same Bourne you get with sh, but a quite reasonably functional shell nonetheless.