Important is, that every subfile is separated by $$$$
So the data look like: file test.sdf
line1
line2
line3
line4
$$$$
line6
line7
line8
line9
line10
$$$$
etc.
and I need have separated files
file1.mol
line1
line2
line3
line4
file2.mol
line6
line7
line8
line9
line10
etc.
I tried to write a script but it looks like it does not work.

here is my code:
Code: Select all
@ECHO OFF
SET "destdir=C:\Users\miru\Desktop"
SET "extensions=mol"
SET "output="
FOR /f "delims=" %%a IN (test.sdf) DO (
IF "%%a"=="$$$$" (SET "output=Y"&SET "ext="
) ELSE (
IF DEFINED output (
IF NOT DEFINED ext FOR %%s IN (%extensions%) DO IF /i "%%a"=="%%s" SET "ext=%%s"
)
)
GOTO :EOF
thank you for response
