Name: Anonymous 2006-05-20 16:05
Hey guys,
Here's the problem I'm coding against: I download a lot of anime from various digisubbing groups, and they ALWAYS put their tag at the front of the file, so if you have some episodes from one team, and some eps from another, Windows will never sort them in a group, because the start of the filenames could be "[mahou]", "[AF-F]", "[wind]", etc... so even while looking at the directory with all my episodes in it, I have to do a file search to see if I have some episodes by another group, or read the name of every file I have.
I don't really care who subbed it more than what show it is, so I want to remove the tag from the front of the filename. Being a nice guy though, I want to keep it in the filename and just move it to the end instead of the front.
A task like this would be pretty simple in most serious, compiled languages, but I'm thinking there should be some way to do this in a DOS/Windows batch file? Does anyone know a way to do a letter-by-letter parsing of a filename, using [ and ] as sentinel characters?
I'm thinking I may even be able to do it sloppily by either putting everything from the start of the filename up to the first ']' into a variable, then somehow deleting it from the filename and reappending it. As an alternative, maybe I could scan each character and append each one to the contents of a variable until I hit ']'
Either way, I have no idea how to scan a filename with that level of granularity... can anyone point me in the right direction?
Thanks
Here's the problem I'm coding against: I download a lot of anime from various digisubbing groups, and they ALWAYS put their tag at the front of the file, so if you have some episodes from one team, and some eps from another, Windows will never sort them in a group, because the start of the filenames could be "[mahou]", "[AF-F]", "[wind]", etc... so even while looking at the directory with all my episodes in it, I have to do a file search to see if I have some episodes by another group, or read the name of every file I have.
I don't really care who subbed it more than what show it is, so I want to remove the tag from the front of the filename. Being a nice guy though, I want to keep it in the filename and just move it to the end instead of the front.
A task like this would be pretty simple in most serious, compiled languages, but I'm thinking there should be some way to do this in a DOS/Windows batch file? Does anyone know a way to do a letter-by-letter parsing of a filename, using [ and ] as sentinel characters?
I'm thinking I may even be able to do it sloppily by either putting everything from the start of the filename up to the first ']' into a variable, then somehow deleting it from the filename and reappending it. As an alternative, maybe I could scan each character and append each one to the contents of a variable until I hit ']'
Either way, I have no idea how to scan a filename with that level of granularity... can anyone point me in the right direction?
Thanks