Kiran Sonawane
asked on
Batch file Remove "ECHO is off " from output file
Batch File code
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
bcp "select 'Name', 'EIN', 'AccountId', 'Other ID', 'Address Line 1', 'Address Line 2', 'City', 'State', 'Zip Code', 'Country', 'Other Data', 'Provider ID', 'Group ID' union all select * from testdb" queryout "C:\Data\CAAGBusinessFile.txt" -c -test\T_GSS -testuser -mypass
call :StripBlankLines CAAGBusinessFile.txt
bcp testdb out "C:\Data\CAAGIndividualsFile.TXT" -c -SNTSMSQL15011A\T_GSS -tesur -Ptest
call :StripBlankLines CAAGIndividualsFile.TXT
:StripBlankLines
For %%x in (%*) do set OutF=temp_(%%~nx).txt
::del %OutF%
for /F "tokens=* delims=" %%B in (%*) do echo %%B >> %OutF%
Goto :EOF
:End
Output
kiran G Sonawane 12 1 1 Rahatani Pune MH 41125 IN O 1 1
ECHO is off
test 233
Prakash S Tike 33 2 2 Don K 456 1
not sure which of the lines of code result in that line, and if nothing helps, you rework the file with another cat + find > newfile to skip that line ...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@oBdA: You are champion 500+