I was given this script to use which creates multiple copies of the same file, all named from a list.
It works perfectly other than an extra blank line being created after the word clank.
I need the files to contain only the word clank on its own line, with no additional spaces or blank lines.
I can easily go into each file and remove the blank line after the fact, but it’s not feasible with hundreds of files to create.

::: Implicit
:::: Ensure there are NO SPACES in this path
SET FileList=List.txt
FOR /F "TOKENS=*" %%F IN (%FileList%) DO (
    ECHO. >>"%%~F.mat"
    CALL :CreateFile "%%~F.mat"
ECHO ^clank>"%~1"

Here’s a couple of images. One showing what the file looks like upon creation, and the other showing what it should look like.

with blank line as created
without blank line after manual editing

I’m very new to batch scripting so not entirely sure what I’m looking to do. I’ve been digging around since yesterday but everything I try is to no avail.

New contributor

exile is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.