回复 37# 13545876873
我想你要的结果可能是除了正常分组序列的字符之外,还要将序列向右偏移17个字符,看看这样是否符合你的需求,未经测试: | @echo off | | cd /d "D:\基因合成\2022.5\" | | for /d %%i in (*) do ( | | move "D:\测序结果\*-%%i-*.ab1" "%%i\" | | ) | | for /d %%i in (*) do ( | | pushd "%%i" | | set x=0 | | setlocal enabledelayedexpansion | | for /f "delims=" %%j in ('findstr ">" %%i.htm') do ( | | set "str1=%%j" | | set "str1=!str1:"color:red;">= ### !" | | set "str1=!str1:</span>= ### !" | | set "str1=!str1:<= !" | | for %%l in (!str1!) do ( | | if "!str2!" == "###" ( | | set /a x+=1 | | set _!x!=%%l | | ) | | set str2=%%l | | ) | | ) | | for /f "tokens=2-4 delims=-" %%a in ('dir /b /a-d *.ab1') do ( | | setlocal enabledelayedexpansion | | for /l %%d in (%%b,1,%%c) do ( | | set var=!var!!_%%d! | | ) | | set /a n=%%c+1 | | if defined _!n! ( | | for %%e in (_!n!) do ( | | echo,!var!!%%e:~,17!>%%a-%%b-%%c.txt | | ) | | ) else ( | | echo,!var!>%%a-%%b-%%c.txt | | ) | | endlocal | | ) | | endlocal | | popd | | ) | | pauseCOPY |
|