Francisco
asked on
remove blank line - windows 7 scripting - to avoid "Echo is off"
hi
I have basic query regarding Windows Scripting on Windows 7 command prompt.
there is batch like below.
<Start of file>
@ECHO off
FOR /F "usebackq eol=; delims=" %%i IN ("file.sql") DO (
IF NOT "%%i" EQU "" ECHO %%i >> test.txt
)
ECHO;
ECHO ************************** ******
pause
<end of file>
input file.sql has multiple blank lines, which will resulted to see lines like this.
ECHO is off.
I would like to avoid this case, would somebody please help to advice how I can simply skip blank line so that "ECHO is off." will not be printed?
I have basic query regarding Windows Scripting on Windows 7 command prompt.
there is batch like below.
<Start of file>
@ECHO off
FOR /F "usebackq eol=; delims=" %%i IN ("file.sql") DO (
IF NOT "%%i" EQU "" ECHO %%i >> test.txt
)
ECHO;
ECHO **************************
pause
<end of file>
input file.sql has multiple blank lines, which will resulted to see lines like this.
ECHO is off.
I would like to avoid this case, would somebody please help to advice how I can simply skip blank line so that "ECHO is off." will not be printed?
If %%i begins with a SPACE character, that would happen.
ASKER
thanks, how can I skip that case, a space in addition to blank within this windows script?
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Dear NewVillageIT, oBdA
Thank you very much to both for support! It works perfectly!!
Thanks Regards
Thank you very much to both for support! It works perfectly!!
Thanks Regards