Thread: program to automatically edit filenames

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    16

    Question program to automatically edit filenames

    I have a lot of files which I'd like to remove a set of parantheses from the filenames, and there are just too many to do by hand. I was wondering if there would be a way to write a program to search for parantheses in the name of the file and rename it with the parantheses removed. Any ideas? Thanks!

  2. #2
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    Unfortunetely, you can't do this with standard C++ without any system calls .
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

  3. #3
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    or you could make a batch file...
    hasafraggin shizigishin oppashigger...

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    16
    My OS is win xp, but i could also use win 98 if that would make it easier. I'm using Codewarrior for my compiler. I'm not incredibly experienced in coding: how would I make a batch file and how would I use that? Thanks for your help.

  5. #5
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    well i don't think i'll be going through the trouble of teaching you batch file programming as a whole, but look it up, basically crank up your favorite binary text editor and type in console commands with some wildcard parameters of the changes you'd like to make to your file names and launch it... seek and ye shall find...
    hasafraggin shizigishin oppashigger...

  6. #6
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    I had once made a program which did something of that kind - it renamed all .txt files in the directory to .cpp

    I used findfirst()/findnext functions along with rename(). i dont know wether it is std or supported by CW.

    What you have to do is just check if the filename contains a bracket and then rename it to your liking.
    -

  7. #7
    Registered User
    Join Date
    Feb 2002
    Posts
    16
    Thanks a lot, I appreciate the help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 07-02-2007, 12:32 AM
  2. Replies: 3
    Last Post: 07-23-2005, 08:00 AM
  3. File Types Automatically Open With My Program
    By ElWhapo in forum Windows Programming
    Replies: 3
    Last Post: 12-29-2004, 05:39 PM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM