1. how to "batch" rename files?
- Posted by Dan Moyer <danielmoyer at prodigy.net> Sep 01, 2006
- 546 views
I wanted to rename a bunch of files in a bunch of directories, all directories are under one directory, retaining some "numbers" originally present in the files names, and then adding numbers which represent the directories the files are in. eg: directory: CDdisk1 files: 01 track 01.wma, 02 track 02.wma, etc rename to: 01 01.wma, 01 02.wma (disk number followed by track number) Intention was to rip tracks from "books on CD" to put onto MP3 player. But in order to have the files in player ordered properly sequentially, I have to rename them from what the ripping yields, 'cause every way I tried to copy them to player yielded mal-sequencing, until I renamed them as above. So I wrote a program to do it; everything eventually worked, UNTIL I got to: SYSTEM command to do the actual RENAMEING, which seems to require "hard" text, no VARIABLE allowed. I hope I'm missing something!! Can
system("rename...",2)
be used to reference filenames in variables, or is it limited to what you type into the quotes? If system can't be used as I envisioned, is there another way to programmatically rename files with varying parts of names??? Dan Moyer
2. Re: how to "batch" rename files?
- Posted by Dan Moyer <danielmoyer at prodigy.net> Sep 01, 2006
- 513 views
I just found Daniel Berstein's "Standard DOS directory and file maipulation functions" in the archive, which look like they could work. But I'm too tired to "maipulate" right now :) Dan
3. Re: how to "batch" rename files?
- Posted by Juergen Luethje <j.lue at gmx.de> Sep 01, 2006
- 525 views
Dan Moyer wrote: <snip> > Can > }}} <eucode> > system("rename...",2) > </eucode> {{{ > be used to reference filenames in variables, or is it limited to what you > type into the quotes? <snip> Just use something like the following:
sequence myvar myvar = "\"the old.txt\" \"the new.txt\"" -- or whatever is required system("rename " & myvar, 2)
Regards, Juergen
4. Re: how to "batch" rename files?
- Posted by Dan Moyer <danielmoyer at prodigy.net> Sep 01, 2006
- 525 views
Juergen Luethje wrote: > > Dan Moyer wrote: > > <snip> > > > Can > > }}} <eucode> > > system("rename...",2) > > </eucode> {{{ > > be used to reference filenames in variables, or is it limited to what you > > type into the quotes? > > <snip> > > Just use something like the following: > }}} <eucode> > sequence myvar > myvar = "\"the old.txt\" \"the new.txt\"" -- or whatever is required > system("rename " & myvar, 2) > </eucode> {{{ > > Regards, > Juergen Thanks Juergen, I suspected I was missing something obvious, sigh. Dan