If you already have the sed command worked out, maybe you could try the next loop (in bash)?
Code:
IFS="\n";
for fromFile in `cat list_of_files_with_spaces`; do
toFile=`echo ${fromFile} | your_sed_command`;
mv "${fromFile}" "${toFile}";
done;
You may want to echo the "mv" command before actually executing it, just to make sure that it does what you expect it to do.
Alternatively, say you have the file names with spaces in one file and the sed'ed file names in another, then you can use "paste" utility to combine both files (it kind of concatenates line by line), using an easy field separator like ',' or so.
Then you can go over that file in a loop (again, line-wise), each time using 'cut' to get both fields into a variable. Or simply use "sed" directly to create the mv commands.
Example:
Code:
file1=/path/to/some/file #file1 contains the win-style file names with spaces
file2=/path/to/2nd/file #file2 contains the "corrected" file names
#The first sed adds the "mv" command and an opening double quote in front,
#the second replaces the ',' delimiter with the closing double quote and adds a space for the mv command
paste --delimiters=, file1 file2 | sed -e 's/^./mv "&/' | sed -e 's/,/" /' > yourScript
After this, examine the results in file yourScript. If they're OK, make the script executable and run it.