Link to home
Create AccountLog in
Avatar of Francisco
FranciscoFlag for Japan

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?
Avatar of NVIT
NVIT
Flag of United States of America image

If %%i begins with a SPACE character, that would happen.
Avatar of Francisco

ASKER

thanks, how can I skip that case, a space in addition to blank within this windows script?
SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Dear NewVillageIT,  oBdA

Thank you very much to both for support! It works perfectly!!

Thanks Regards