In tip 7425, I scripted StripBN.bat to strip blank and null lines from a file
that did not contain CMD control characters.
Using ReadIn, I have scripted StripBNC.bat to strip blank and null lines from a file that may contain CMD control characters.
The syntax for using StripBNC.bat is:
StripBNC FileName
NOTE: StripBNC.bat will also remove leading spaces on each line.
StripBNC.bat contains:
@echo off If \{%1\}==\{\} @echo Syntax Call StripBNC FileName&goto :EOF if not exist %1 @echo StripBNC %1 not found.&goto :EOF setlocal set file=%1 if exist %TEMP%\StripBNC.tmp del /q %TEMP%\StripBNC.tmp for /f "Tokens=*" %%i in ('ReadIN /f=%file% /c') do set line=%%i&call :parse1 ReadIn /F=%TEMP%\StripBNC.tmp /A /o=%file% if exist %TEMP%\StripBNC.tmp del /q %TEMP%\StripBNC.tmp endlocal goto :EOF :parse1 set work=%line: =% if "%work%" EQU "" goto :EOF @echo %line%>>%TEMP%\StripBNC.tmp
0 comments
Hide comments