It seems that using a parenthesized code block causes a trailing space in the output.
Code: Select all
@Echo off
(echo 1
echo AZ)|findstr "1 AZ">>spaces.txt
(echo AZ)|findstr "1 AZ">>spaces.txt
echo AZ|findstr "1 AZ">>Nospaces.txt
pause
Code: Select all
C:\Users\Squashman\Desktop>so
C:\Users\Squashman\Desktop>(
echo 1
echo AZ
) | findstr "1 AZ" 1>>spaces.txt
C:\Users\Squashman\Desktop>(echo AZ ) | findstr "1 AZ" 1>>spaces.txt
C:\Users\Squashman\Desktop>echo AZ | findstr "1 AZ" 1>>Nospaces.txt
C:\Users\Squashman\Desktop>pause
Press any key to continue . . .
I am thinking that their only other possible solution would be to create a temp file with the 1 and AZ on each line and execute the program like so:
Code: Select all
Z:\Models\LossCalc.exe<tempfile.txt
Or am I just completely wrong on this?
Would creating the Carriage Return and Line Feed variables work?
Code: Select all
echo 1!CR!!LF!AZ!CR!LF!|Z:\Models\LossCalc.exe