Can I substring the a temp file I create in an echo statement? and use that

Klonner

Honorable
Dec 17, 2012
2
0
10,510
Hello,
I am trying to take some text files and add the filename into the file. The output cannot have any carraige return characters in it due to the processing that happens. The output also need to be 512 in length. Here is what I have so far. It works but adds a carriage return from the header.tmp file which is understandable but messes up the load job.

for %%i in (FXD_*) do (
echo RH%%i > header.tmp
copy /a header.tmp /a +HDR_Filler.txt /a +g:\SOURCE_FILES\%%i.bak /a %%i

Thanks for your help