Newbie questions from a non-programmer

Started by Neil Jones, January 09, 2014, 02:34:39 PM

Previous topic - Next topic

Neil Jones

I started off trying to see if Regex with a file rename program would work to do the following. So far I'm not having much luck figuring out if it can or finding a place for Regex support. 

I have a thousands of folders that need to be renamed. Some have words that are all uppercase that need to change to the first letter of each word being uppercase with rest of the word being lowercase. Some have periods that separate the words where I wish to insert an underscore. Some have strings that start with lowercase that I wish to change to uppercase. I need to deal with all these conditions and change them in one shot. If I need to make changes to the same folders that reside on different hard drives can this be done in one shot?

Can WinBatch automate this process for me? How much coding would it require? I haven't coded in many years now and when I did I wasn't great at it.

Suggestions, please!

If Regex will work, I need a really well done tutorial because I'm no programmer and I'm not the brightest bulb on the Christmas tree. I also suffer from having a very low tolerance for bad tutorials.


Deana

Yes, WinBatch can automate this. It would require a bit of coding on your part. We do not have an existing code sample that would fit your needs in our tech database.

Take a look at the StrSub, StrSubWild, StrIndex and StrIndexWild. OR if you need more complicated string search then check out these RegEx UDFs in the tech database: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP/RegExp+Regular~Expressions~UDFs.txt

StrTypeInfo can be used to determine is a character is upper or lower case.

FileRename would be used to rename a file.

Does your script need to recurse directories? If so I recommend using the File and Folder Extender to handle the directory recursion.

Maybe someone here has some existing code they will share? Anyone?

Deana F.
Technical Support
Wilson WindowWare Inc.

kdmoyers

1. this is exactly the sort of thing Winbatch is good for.

2. it does call on a few different techniques, so no one tutorial/example is going to do it all

3. does not sound like you need regex

4. honestly? it's probably a little outside the bounds of a newbie project.

5. advice if you have time and are willing to do some head scratching: break this problem into parts and learn how to do each one separately.  First part: write something that simply lists everything that needs to be changed.  Post your attempts here. Be patient. People will help.

6. advice if you have more money than time: ask if anyone here wants to do it for you on a T/M basis, with source code provided.  You get the job done, and you get some great example code to examine.  (I am *not* a candidate).  Be sure to give an email address where you can be contacted.

Just my $0.02,
-Kirby
The mind is everything; What you think, you become.

td

Very sound advice.  But one word of caution; do not post email addresses on this forum.  We do are best to keep harvesting bots at bay but no system is perfect.  If you need to communicate directly with another member of this forum, use the private message functionality.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

Neil Jones

Hello and thanks everyone for your help and suggestions. I finally found the RegEx tutorial help I needed on Lynda.com and feel confident that I can learn to use RegEx and get proficient with it.

I think what I want to do is write a bunch of RegEx scripts and run them one right after another in a file/folder renaming program. Has someone created a program like this that lets you use WinBatch to do custom automation? I have started using a file/folder renaming program called Bulk Rename Utility. It's a pretty decent program and it does a lot of stuff without needing RegEx scripts. I think I can do what needs to be done on my own if I find a file renaming program that fully supports RegEx scripts and makes them easy to manage and run. The Bulk Rename Utility program doesn't make running RegEx scripts or even saved preferences easy to manage. Windows does the managing with File Open. :(  I think there should be away to do run RegEx scripts that is integrated within a file renaming program so it's not so cumbersome. Also, I haven't found a way to combine saved preferences in Bulk Rename Utility and this means I have to manually run my saved preferences, that do different things, one after an other and in the order I need. I'd love to be able to combine these saved preferences and create a name for a condition to make things more automated. So far I don't see a way to do this in the Bulk Rename Utility program.

ChuckC

Here's something that I don't think that I saw mentioned in any earlier discussions:

Going back to the original post in this thread, there are statements made about needing to rename directories where the only differences between the old names and new names are differences in the upper/lower case of certain letters.  Please note that in the NTFS [and ReFS and CVFS] file systems on Windows, the file systems preserve case in names but look ups and tests for uniqueness are case-insensitive.

In practice, for example, this means that "my stuff", "MY STUFF" and "My Stuff" are all the same name, and attempts to rename a folder from one such name to another result in nothing happening.  Instead, something has to be done to rename the folder to some other unique name before renaming it a 2nd time to give it the desired name.

DAG_P6

I'm confused and curious. How is it that a non-programmer knows about regular expressions?
David A. Gray
You are more important than any technology.

kdmoyers

Quote from: DAG_P6 on January 25, 2014, 11:25:31 AM
I'm confused and curious. How is it that a non-programmer knows about regular expressions?
He's a cultured, sophisticated, man about town!
(apologies to Mel Brooks)
The mind is everything; What you think, you become.

DAG_P6

Quote from: kdmoyers on January 26, 2014, 06:45:32 AM
Quote from: DAG_P6 on January 25, 2014, 11:25:31 AM
I'm confused and curious. How is it that a non-programmer knows about regular expressions?
He's a cultured, sophisticated, man about town!
(apologies to Mel Brooks)
Obviously.  ;D

It just seems odd for the OP to refer to himself as a non-programmer, yet the rest of his message suggests that he really does know what a Regular Expression is, and why they are useful. Nevertheless, I've always considered them to be rather arcane, and not the stuff to which most non-programmers would gravitate.
David A. Gray
You are more important than any technology.