Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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.

![]() |
![]() |
![]() |

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