Try:
perl -le 'print $ARGV[-1] =~ s/[\da-zA-Z]+(?=\.)/++($i=$&)/er' file*.txt That will give you file_10.txt after file_9.txt, file_g.txt after file_f.txt, file_aa.txt after file_z.txt, but not file_ab.txt after file_aa.txt or file_11.txt after file_10.txt because the file* shell glob will sort file_z.txt after file_aa.txt and file_9.txt after file_10.txt (that.
That latter one you can work around with zsh by using file*.txt(n) instead of file*.txt.
Or you can define a numeric sort order in zsh, based on those aa, abc being recognised as numbers in base 36:
b36() REPLY=$((36#${${REPLY:r}#*_})) perl ... file_*.txt(no+b36) (note that the order is ...7, 8, 9, a/A, b/B..., z/Z, 10, 11... so you don't want to mix file_123.txt and file_aa.txt).