This batch code aligns the registration number on each output line.
@echo off
setlocal EnableDelayedExpansion
echo Name Reg No.
echo -------------------------------------
for /f "tokens=2,3 delims=' " %%A in ('%SystemRoot%\System32\findstr.exe "Registered" registration.log') do (
set "RegistrationName=%%A "
echo !RegistrationName:~0,19!%%B
)
endlocal
I believe the file registration.logis a tab delimited CSV file, and therefore the character after delims='is the character of the horizontal tab.
, , 19 , 19 , .
findstr:
@echo off
setlocal EnableDelayedExpansion
echo Name Reg No.
echo -------------------------------------
for /f "tokens=1-3 delims=' " %%A in (registration.log) do (
if /I "%%A" == "Registered" (
set "RegistrationName=%%B "
echo !RegistrationName:~0,19!%%C
)
)
endlocal
, , , , .
echo /?endlocal /?findstr /?for /?if /?set /?setlocal /?