I'd like to use an HTML's title as filename, but it may contain invalid characters like question marks, etc.
Do you know of a way to rewrite a string so that it's DOS-legit?
Code: Select all
FOR /F "delims=" %%A IN ('xidel "%1" -se "title:=//title" --output-format cmd') DO %%A
echo %title%
wget -O "%title%.html" "%1"
--
Edit: One way I came across:
Code: Select all
SET title=%title: =_%
SET title=%title:?=%
echo %title%