Computing.Net > Forums > Disk Operating System > simple program

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.

simple program

Reply to Message Icon

Name: Kevin
Date: August 7, 2002 at 12:50:09 Pacific
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: Secret_Doom
Date: August 7, 2002 at 21:26:34 Pacific
Reply:

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


0

Response Number 2
Name: Secret_Doom
Date: August 8, 2002 at 09:57:33 Pacific
Reply:

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


0

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 Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: simple program

Serial port program www.computing.net/answers/dos/serial-port-program/4637.html

Dos command to load program www.computing.net/answers/dos/dos-command-to-load-program/5279.html

copying only cab files from win 95? www.computing.net/answers/dos/copying-only-cab-files-from-win-95/11578.html