rename files with random names in a folder
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: rename files with random names in a folder

  1. #1
    Join Date
    May 2014
    Posts
    2

    rename files with random names in a folder

    hello,

    I am prasanth.

    I need a code for renaming multiple(bulk or all ) files in a folder.


    I found one batch file script but it renaming with numbers only. But i want differntly.
    http://www.howtogeek.com/57661/stupi...n-a-directory/




    Example:

    In a folder there are 100 images and all numbered with some digits or names.

    assume that all images are belongs to "john" , so i want to rename all images with "john+ a random string".

    here a random string means -> it has an array with 3000 english words, (you can predefine them by downloading from dictonary).

    In the script the 3000 names are fixed, but the 1st name will be changed by my wish. that my be john, mary, sai, pavan etc...


    Pleaes any one solve this problem....

    Sugestion: you do not need to enter all 3000 words in array manually. some javscript codes are there to read input of each and evey line and them into an array.

  2. #2
    Join Date
    May 2014
    Posts
    2

    Re: rename files with random names in a folder

    so that every image will get name like this john good, john bad, john eating, john idiol, john silly etc.........

  3. #3
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,121

    Re: rename files with random names in a folder

    Quote Originally Posted by prasanthssn View Post
    so that every image will get name like this john good, john bad, john eating, john idiol, john silly etc.........
    Which part are you stuck on?

    Can you get the dictionary into an array?
    Can you enumerate the files in a directory?
    Can get unique words from the array randomly?
    Can you rename files?

    If it were me, I'd load the words into a vector or list and call random_shuffle to arrange them randomly, then pull each successive word out of the list for each file I found. That's just one of several approaches.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center