Anyone know how to find comma in filenames?

Discussion in 'Computer Games and General Discussion' started by twiztidsinz, Apr 24, 2011.

Apr 24, 2011
  1. twiztidsinz
    OP

    Member twiztidsinz Taiju Yamada Fan

    Joined:
    Dec 23, 2008
    Messages:
    4,981
    Country:
    United States
    Seems I've run into a small dilemma. On a 'project' I've been working on I've been adding a number prefix to the filename (##. ), and to speed up the process and ensure uniformity, I've been using Magic File Renamer to do it automatically.
    However, I think I mistyped "," instead of "." in the filenames on some files.

    It wouldn't be an issue to go back and check them, but I'm dealing with 4,864 files and 771 folders -- and growing.
    Neither explorer's search nor command prompt return anything useful, they just list all files/folders.
     
  2. Originality

    Member Originality Chibi-neko

    Joined:
    Apr 21, 2008
    Messages:
    5,149
    Location:
    London, UK
    Country:
    United Kingdom
    IIRC, windows doesn't support having a comma in the filename at all. What that implies to your batch operation, I have no idea...
    EDIT: I stand corrected.
     
  3. twiztidsinz
    OP

    Member twiztidsinz Taiju Yamada Fan

    Joined:
    Dec 23, 2008
    Messages:
    4,981
    Country:
    United States
    While I'm not positive, as far as I know any version of Windows that supports long file names (more than 8+3) also supports commas.
    However I do know for a fact that Windows XP/Vista/7 all support commas in file names:
    [​IMG]
     
  4. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,403
    Location:
    Engine room, learning
    Country:
    France
    Can't Magic File Renamer do it too ?
    Like "replace the 3rd character by a dot" ?


    I'm using an old program to mass rename my files, there's certainly better but I'm fine with this one :
    http://www.numerama.com/telecharger/6360-renamer-plus.html

    No installation required.

    Though, it's all in French [​IMG]

    it can rename a specific string, rename a character at a specific place, add a counter, delete part.


    To replace a string :
    You drag/drop the files or folders in the rightmost part
    Then on the "mass" tab, you tick the checkbox for the action you want to do : "changer tous les , par des ." (change all the , with .)
    Then you click "OK" button, and it will verify if there's no conflict with the new name scheme, if you agree with the result you can confirm the change.

    If you don't click the "ext" icon, it won't affect the file extension ".ext", so you can even rename all the dots in a filename into something else, the extension will be kept.

    It doesn't rename folder though, only the files in the folders.
     
  5. twiztidsinz
    OP

    Member twiztidsinz Taiju Yamada Fan

    Joined:
    Dec 23, 2008
    Messages:
    4,981
    Country:
    United States
    Yeah MFR can do it... but it takes a long time to load the 771 folders, I'd rather not try to add nearly 5k files.
    However, not all the file names are uniform and some aren't even numbered so replacing based on position might do more harm than good.

    I'll check out the app you listed above tomorrow, going to bed for now.
     
  6. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,705
    Country:
    United Kingdom
    Assuming you have not otherwise sorted it my usual standby appears to work

    dir /b *,* >>a.txt (if you have subdirectories stick a /s in there)
    A nice simple text list of all files call a.txt will appear

    Throw it around in a spreadsheet and add a rename command, find and replace commas somewhere along the line, you are probably going to want to wrap the names in quotes unless you have spaces in names or directories, tidy it up in a text editor (remove tabs and maybe change quotes if they end up as inverted quotes) and you have yourself a nice batch file. Crude certainly but it can be done without resorting to installing odd programs.
     
  7. spinal_cord

    Member spinal_cord Knows his stuff

    Joined:
    Jul 21, 2007
    Messages:
    2,871
    Location:
    somewhere
    Country:
    United Kingdom
    Give this a try -

    renamer.rar

    It's specifically for changing "," to "." in filenames. the source is includes, but its in blitz basic, so might not be of any use.

    Just put it in the lowest folder and run, it should then search through all sub folders renaming files containing commas, hopefully it wont do any damage as its using a cmd window to do the renaming (a dos window should rapidly open and shut as it renames files).

    Disclaimer
    Although I tested this on my own computer and it seemed to work correctly, if by any weird occurrence it kills any or part of your computer, I take no responsibility for that.
     
  8. ZAFDeltaForce

    Member ZAFDeltaForce Specialist

    Joined:
    Sep 9, 2006
    Messages:
    2,786
    Country:
    Singapore
    ^ I too highly recommend ReNamer

    You can add rules to batch-rename files.

    There's a rule where you can choose to replace characters with other characters, such as substituting that comma with a full stop
     
  9. twiztidsinz
    OP

    Member twiztidsinz Taiju Yamada Fan

    Joined:
    Dec 23, 2008
    Messages:
    4,981
    Country:
    United States
    Thanks guys... got it sorted out.


    Ended up going with an idea based on FAST's post.
    Unfortunately, searching "*,*" returns ALL files, so I just exported them all to text file and did a regex search for "\d\d, " and deleted all the lines that didn't have a match. Then threw them into Magic File Renamer with a similar RegEx replace ("(\d\d), " -> "$1. ").

    60 some-odd files were easier to manage than nearly 100x that.
     

Share This Page