enbar says: Via Digistrom (http://snurl.com/1b9j2). Enbar, if you're familiar with Perl & regular expressions, you might want to give this a go:
Actually, I have to admit, I have no clue about Perl or regular expressions. What you just posted is a little intimidating... It's not as bad as it looks. You can still use the script even if you're not familiar with Perl. Just copy the text out to a file, rename it to something like rename.pl, download a Perl interpreter - I recommend ActivePerl, and then you'll need just need a passing familiarity with regular expressions (really it's not that hard to learn). Here are some pretty common regular expressions I use with the script. Say I have three files Program.txt, Program.exe, and Program.MD5. Now I want rename them from Program to AnotherProgram. To do this I'd open a comm... Ahem ... It uses the pattern (.*?)\. and it scans all the way across the string until it sees the period. Then everything to the left of the period is stored away and can be accessed later by referencing ${1}. Meaning ${1} will contain ProgramThe dollar sign $means match the end of the string. So the full expression (.*?)\.(.*$)simply means match ALL character up till the period in the filename and store them in ${1}. Then after the period store ALL characters up till the end of the string in ${2}. Or in other words, save the filename to ${1} and the extension to ${2}. So the string we were using as an example - Program.txt - will result ... |
View the Top Clips from February 25, 2007
|
|
|
|
|
New from the makers of Clipmarks: Amplify.com - Don't just share the news...Amplify it!
|
|