FOR /F %a in (downloadlist.txt) DO (
SET url=%a
&& SET suffix=%url:ftp://ftp.ncbi.nlm.nih.gov/genomes/all=%
&& SET combined=%url%%suffix%
&& SET a_link=%combined%%assembly%
&& echo %a_link%
&& SET t_link=%combined%%transcripts%
&& SET cds_link=%combined%%CDS%
&& SET p_link=%combined%%protein%
&& WGET %a_link%
&& WGET %t_link%
&& WGET %cds_link%
&& WGET %p_link%
)
如何将其分解为多行?这就是我目前所做的,它不起作用。我也尝试过使用^字符。我究竟做错了什么?
答案 0 :(得分:1)
将未知变量值汇编,转录本,CDS,蛋白质替换为您的实际值,将此脚本保存到文件 test.bat 并从Cmd窗口运行它。发布确切的错误消息(如果有)。
@echo off
setlocal enabledelayedexpansion
set "assembly=1" & set "transcripts=2" & set "CDS=3" & set "protein=4"
FOR /F %%a in (downloadlist.txt) DO (
SET url=%%a
SET suffix=!url:ftp://ftp.ncbi.nlm.nih.gov/genomes/all=!
SET combined=!url!!suffix!
SET a_link=!combined!%assembly%
echo !a_link!
SET t_link=!combined!%transcripts%
SET cds_link=!combined!%CDS%
SET p_link=!combined!%protein%
WGET !a_link! && WGET !t_link! && WGET !cds_link! && WGET !p_link!
)
exit /b