| 1. |
Solve : make multiple folders with files from a list file? |
|
Answer» I have a text file exported from the movie collectorz program and I want to add my DVD collection to xbmc through stub files. I found this code and modified it to give me the files. If you are not using the Script that was provided to you on the other forum (DosTips.com) you posted this question on please post the code you are using. Ok it's complicated just because I was in charge of it.... this is my test text file I PUT a bunch of goofy stuff in it to see if it would fly. everything but the colon goes through. I only make the files with a .dvd extension here cause it was messing me up to have both EXTENSIONS (dvd.disc) Code: [Select](500) Days Of Summer!;2009 6th Day, The;2000 10,000 Bc;2008 11:14;2005 2010: The Year We Make Contact;1984 Brüno;2009 Disney Surf's Up;2007 Dolan's & Cadillac;2009 This script takes the names and outputs the files into a subfolder named files.... this is the 30th or 50th thing I tried Im not sure why it works but it does...LOL with the EXCEPTION of the two names with colons. Code: [Select]set dir=C:\temp\test\files\ set ext=dvd for /f "tokens=1,2 delims=;" %%a IN (haa.txt) do >"%dir%\%%~a (%%b).%ext%" ( echo.^<discstub^> echo.^<message^>%%~a is located in the DVD rack^</message^> echo.^</discstub^> ) This file is in the files folder it takes the files appends the .disc ext and moves it into the folder it has just created. Im praying that when I do the whole list of 3000 it don't go bananas Code: [Select]echo off for %%a in (*.*) do ( md "%%~na" 2>nul ren *.dvd *.dvd.disc move "%%a.disc" "%%~na" ) pause I'm sure there are better ways to do this and if I spent my time learning to write code instead of chasing women drinking beer and watching movies I'd have more time to watch movies ... **edit** well there are other things that mess it up like the u with two dots above it (WITCH I cant even find on the keyboard..LOL) the ? mark also messes it up and my copy of alien3 the 3 is in subscript that also don't make it through the ringer. but for those three files I can make corrections I suppose I can just do a search and replace in the text file and get rid of all the miscellaneous crap. **EDIT** I just ran the file through a search and replace program and removed all the illegal charters so all is good. Quote from: Veltas on January 04, 2012, 09:30:49 AM A colon is not allowed in the name of a file or folder on Windows. So whether or not a batch file can read it, for this purpose it's irrelevant. You'll need to think of different names! Yeah I understand this fact, I was looking for a way to remove them in the batch file on the fly. |
|