I have some files like this:
file.i001.trusted.txt file.i002.trusted.txt ... ... file.i212.trusted.txt
Now I want to change index numbers from i001 to i030 to A101 to A130 and i031 to i060 as A201 to A230..
I'm using "renamex" under FreeBSD primarily ( which has regex support )..
Usage: renamex [OPTIONS] filename ... OPTIONS: -f, --file Load file names from the file -l, --lowercase Lowercase the file name -u, --uppercase Uppercase the file name -s/PATTERN/STRING[/SW] Replace the matching PATTERN with STRING. The SW could be: [i] ignore case when searching [b] backward searching and replacing [s] change file's suffix name [r] PATTERN is regular expression [e] PATTERN is extended regular expression [g] replace all occurrences in the filename [1-9] replace specified occurrences in the filename -R, --recursive Operate on files and directories recursively -o, --owner OWNER Change file's ownership (superuser only) -v, --verbose Display verbose information -t, --test Test only mode. Do not change any thing -h, --help Display this help and exit -V, --version Output version information and exit -A, --always Always overwrite the existing files -N, --never Never overwrite the existing files Please see manpage regex(7) for the details of extended regular expression.
What do you suggest?
Edit: The ranges could be different. So it will not be 30 items always. For example A1 is 30 items, A2 is 40 items, A3 is 25 and so on...