dos batch file conversion

Oct 2, 04:24 AM

large task: take thousands of files and rename them

step one:

dos:
DIR /S /B *.SWA >names.bat

/s does the subdirectores
/b does the full file names

step two:


vim:
%s/\\\(\w*\)\.SWA/&^I^I\1.mp3/ – copy the end of the line and change the copy from from whatever.SWA to whatever.MP3

%s/\(Documents and Settings\)/”\1”/gc – put Documents and Settings into quotes

%s/^/RENAME^I – insert RENAME at the beginning of the line

step three:


dos:
names.bat

Mark Edwards

,

---

Commenting is closed for this article.

---