I have 2000 URLs in excel file. The URLs are in the first column and in the second column there are names for the files downloaded from URL in the first column. I can copy that and paste to .txt file if it's needed, no problem.
File names contain spaces. I need to do this on Windows 7.
Could you help me?
@Edit:
Well, sorry If my problem is unclear. I'm not english native speaker. I have URL in first column and and I want to save the file downloaded from this URL with name from the second column. I want that spaces to be there. I want to download all the files with one command or batch file using "wget" tool.
Best Answer
Steps
Open your worksheet in Excel and click File ā Save As.
Close Excel to unlock the file.
Choose CSV (comma separated values) as type and same your file as
urls.csv
.Open a command prompt, execute
and identify the value separator (character placed between URL and file name.
If it's, e.g., a semicolon, execute the following command:
How it works
Excel saves the URLs and corresponding names as comma (or semicolon) separated values.
Example:
for /f ... %a (urls.csv)
goes through all lines and saves the first value in%a
and the second in%b
.Here,
delims=;
specifies the semicolon as value separator andtoken=1,2
specifies that there will be two tokens.wget -O "%b" "%a"
saves%a
in%b
. Since the URL is quoted, Wget will automatically take care of spaces and other special characters.The
@
in front of@wget
prevents the commands from being printed.See also: For /f - Loop through text | SS64.com