Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Batch file - move filename pieces

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

Name: Anonymous 2006-05-20 19:50

sounds like it'd be a huge pain to do with dos batch files, and very easy to do with perl regexing. i know neither, so have fun. besides which, why bother learning a new 'programming language' (dos batch files), when you could just use one you already know (c)?

seriously tho, i don't think it's easy to do regexing type stuff with batch files at all, i wouldn't even try.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List