Computing.Net > Forums > Programming > Remove extra line generated by bat

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Remove extra line generated by bat

Reply to Message Icon

Name: Leonard
Date: February 1, 2009 at 22:38:35 Pacific
OS: Windows 2000
Subcategory: Batch
Comment:

Hi,

I have the following batch file that combines the contents of 2 txt files into 1:

***************

:: Get system's current date into multiple variables
@echo off
if "%1"=="GoTo" goto %2
echo e180 BF 07 01 B4 04 CD 1A E8 02 00 89 CA E8 00 00> %temp%.\t1.src
echo e18F 86 D6 88 D0 D4 10 0D 30 30 86 C4 AB 47 C3>> %temp%.\t1.src
for %%? in (rip 180 g w q) do echo %%?>> %temp%.\t1.src
echo SET %%1=XX XX XX XX> %temp%.\t2.bat
DEBUG %temp%.\t2.bat < %temp%.\t1.src > nul
call %temp%.\t2.bat _
%0 GoTo parse %_% MM DD YC YY
:parse
set %7=%3
shift
if not "%7"=="" goto parse
for %%? in (t1.src t2.bat) do del %temp%.\%%?
set _=

copy J:\test\Header.txt+J:\test\Detail.txt J:\test\result_%YC%%YY%%MM%%DD%.txt

***************

And the result is:

***************
result1
result2

***************

Currently, I have to open the file each time and manually press backspace 2 times to remove the and extra blank line after “result2”.

Does anyone knows how could I include additional coding to automatically remove the and extra line?

Many thanks in advance.



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Remove extra line generated by bat

Remove duplicate lines in pure .bat www.computing.net/answers/programming/remove-duplicate-lines-in-pure-bat/15777.html

Remove next line from a .txt file www.computing.net/answers/programming/remove-next-line-from-a-txt-file/18091.html

Send email w/o extra line breaks www.computing.net/answers/programming/send-email-wo-extra-line-breaks/14779.html