Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Is it possible to write a batch file to delete the first 4 lines of a particular text file. It has to be windows based
Thanks

Yep, that's possible. The following batch script will do the job. The sintax is:
filename.bat textfile
Actually, the assembler code makes all the job in this batch script.
===== BATCH SCRIPT BEGIN =====
@echo off
if "%1"=="GoTo:" goto %2
if "%1"=="" goto eof
if not exist %1 goto eof
%COMSPEC% /c %0 GoTo: dbgsrc |DEBUG %1 > nul
goto eof
:dbgsrc
echo e00 83 F9 0 74 1A BE 0 1 3D 4 0 74 9 BF FF 0
echo e10 80 3C A 75 1 40 A4 E2 EF 89 F9 81 E9 0 1
echo g=0 1F
echo w100
echo q
:eof
===== BATCH SCRIPT END =====Watch out for line wrapping!
I haven't tested it on a NT system, but I don't see any reason why it shouldn't work.
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

By the way, here's the asm unasselbled source code:
0000 CMP CX,+00
0003 JZ 001F
0005 MOV SI,0100
0008 CMP AX,0004
000B JZ 0016
000D MOV DI,00FF
0010 CMP BYTE PTR [SI],0A
0013 JNZ 0016
0015 INC AX
0016 MOVSB
0017 LOOP 0008
0019 MOV CX,DI
001B SUB CX,0100-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

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

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