Need to Create 100's of Folders from a .txt file

Discussion in 'General Software' started by supasaiyan, Apr 22, 2012.

  1. supasaiyan

    supasaiyan Member

    Joined:
    Nov 17, 2006
    Messages:
    3,949
    Location:
    3000
    I have a text file with 100's of file names and I need to create a folder for each file.

    Apart from creating manually 100's of folders and then renaming them, I was hoping (praying) someone could recommend software that could do this??
     
  2. poinda

    poinda Member

    Joined:
    Jan 18, 2005
    Messages:
    251
    Location:
    Victoria
    you could copy and paste the names into excel.
    then concatenate the name of the folder to make
    mkdir foldername
    then turn it into a batch file and run it
     
  3. Rezin

    Rezin Member

    Joined:
    Oct 27, 2002
    Messages:
    9,486
    test.txt:

    Code:
    test.txt
    test1.txt
    test2.txt
    test3.txt
    Command prompt:

    Code:
    for /f %a in (test.txt) do mkdir %~na
     
  4. breech

    breech Member

    Joined:
    Mar 6, 2002
    Messages:
    1,800
    Location:
    Syd
    batch files will do it , loop through the text file
    search batch editing ini files (will provide closer results)
    'directories' as well as 'folders'

    things to watch out for:
    illegal characters and folder names being too long.

    heres a link that should get you started
     
  5. zenturio

    zenturio Member

    Joined:
    Aug 23, 2003
    Messages:
    146
    Location:
    Perth 6060
  6. dark_abyss

    dark_abyss Member

    Joined:
    Jul 11, 2001
    Messages:
    617
    Location:
    Adelaide
    Powershell makes this pretty simple

    Code:
    Get-Content textFile.txt | % { mkdir $_ }
    Or if you wanted to strip out the file extensions something like

    Code:
    Get-Content textFile.txt | % { mkdir $_.SubString(0,$_.LastIndexOf(".")) }
     

Share This Page