I need a batch file or text file generation, please.
Posted: 17 Apr 2016 06:47
I'm using Windows 7, and I have a folder with 1683 folders inside it, each containing an issue of the Magnet (a pre-war children's (and adults, the appeal was universal) weekly story paper - http://friardale.co.uk/Magnet/Magnet.htm).
Each of the folders is merely a number;
0001
0002
0003
0004
0005
etc, and I want to edit these so that they also contain the name of each individual story, i.e.;
0001 The Making of Harry Wharton
0002 The Taming of Harry
0003 The Mystery of Greyfriars
0004 Chums of the Remove
0005 Kidnapped
etc. But rather than edit each folder name manually, I'd rather use a batch file, something like;
Rename 0001 "0001 The Making of Harry Wharton"
Rename 0002 "0002 The Taming of Harry"
Rename 0003 "0003 The Mystery of Greyfriars"
Rename 0004 "0004 Chums of the Remove"
Rename 0005 "0005 Kidnapped"
but for all 1683 files of course (and there would need to be quotation marks, of course, in case the name included spaces). And I was wondering if there was a way to generate a text file that would scan the folder, and so find that there was 1683 subfolders and for each subfolder add a line to the text file of;
rename [folder name] "[folder name] "
(the above ends up with a space before the second quotation maeks), so that I end up with;
Rename 0001 "0001 "
Rename 0002 "0002 "
Rename 0003 "0003 "
Rename 0004 "0004 "
Rename 0005 "0005 "
(up to 1683, of course), so that all I have to do then is to manually enter the name of each story, rename the .txt to .bat, and run it.
If this isn't possible, then can someone use Microsoft Word or whatever to auto-generate a text file that contains what I want, please, and post it here. But a program or batch file that could be used to automatically generate the list would be preferable, as then I could use it for other things in the future.
Thanks for any answers.
Each of the folders is merely a number;
0001
0002
0003
0004
0005
etc, and I want to edit these so that they also contain the name of each individual story, i.e.;
0001 The Making of Harry Wharton
0002 The Taming of Harry
0003 The Mystery of Greyfriars
0004 Chums of the Remove
0005 Kidnapped
etc. But rather than edit each folder name manually, I'd rather use a batch file, something like;
Rename 0001 "0001 The Making of Harry Wharton"
Rename 0002 "0002 The Taming of Harry"
Rename 0003 "0003 The Mystery of Greyfriars"
Rename 0004 "0004 Chums of the Remove"
Rename 0005 "0005 Kidnapped"
but for all 1683 files of course (and there would need to be quotation marks, of course, in case the name included spaces). And I was wondering if there was a way to generate a text file that would scan the folder, and so find that there was 1683 subfolders and for each subfolder add a line to the text file of;
rename [folder name] "[folder name] "
(the above ends up with a space before the second quotation maeks), so that I end up with;
Rename 0001 "0001 "
Rename 0002 "0002 "
Rename 0003 "0003 "
Rename 0004 "0004 "
Rename 0005 "0005 "
(up to 1683, of course), so that all I have to do then is to manually enter the name of each story, rename the .txt to .bat, and run it.
If this isn't possible, then can someone use Microsoft Word or whatever to auto-generate a text file that contains what I want, please, and post it here. But a program or batch file that could be used to automatically generate the list would be preferable, as then I could use it for other things in the future.
Thanks for any answers.