I'm having some difficulty getting a batch menu to display correctly:
Code: Select all
echo.- Results 1 = %A% of %B%:
echo.
TYPE File1.out
echo.
echo.- Results 2 = %C% of %D%:
echo.
TYPE File2.out
echo.
echo.- Results 3 = %E% of %F%
echo.
TYPE File3.out
echo.
echo.- Results 4 = %G% of %H%
echo.
TYPE File4.out
CMD output:
Code: Select all
- Results 1 = 1 of 4:
ABC123
- Results 2 = 0 of 3:
DEF456
- Results 3 = 1 of 4
GHI789
- Results 4 = 3 of 4
KLM012
1. Is it possible to make TYPE output further to the right of the screen? It seems the only option is for the File output to "hug" the left of the screen - is there a better way of achieving this result?
2. "- Results 2 = 0 of 3:" - Why is %C% adding three spaces after the output of 0? Although a little confusing, here's how %C% gets its value via file input:
Code: Select all
IF EXIST Ref1.old DEL /F /Q Ref1.old
IF EXIST Ref1.out RENAME Ref1.out Ref1.old
FOR /f %%X in (Ref2.out) DO @( IF EXIST echo.%%X>>Ref1.out )
FINDSTR /V /G:Ref2.out Ref1.out>File2.out
Code: Select all
RENAME File2.out File2.wip
TYPE File2.wip | findstr /I /V /C:"NULL" > File2.out
DEL /F /Q File2.wip
Code: Select all
SET C2=0
:R3
FOR /f %%i in ("File2.out") do set size=%%~zi
IF %FILE% equ 0 GOTO R4
FOR /f %%B in ('Find /V /C "" ^<File2.out') do set C2=%%B
GOTO R5
:R4
SET C2=0
:R5
Reason I took the above approach was to ensure if no input value provided, manually input 0. Same approach taken with the other variables and no problems. I've taken my time to carefully check for spaces, tabs, soft-returns etc - basically anything before or after the '0' yet no luck and it's the only variable doing it.
Thanks for taking the time to check this out, really would appreciate any help or advice provided.
B33lzz