1.

Solve : help! delete first line of text file?

Answer»

Please help! I'm new to dos and have no idea what I'm doing...I'm trying to write a script for an old emulation program and I've tried again and again to use it's script language to delete the first line of a text file and can't figure out how to do it...Then I found two commands that run dos commands and I thought that this would SAVE me, but I haven't been able to figure out a code that does the job. I have posted the help files related to these commands below. I assume that the SHELL command is the ONE that is going to work...I need to run a command that will delete the first line of a .txt file. PLEASE HELP!!! Thanks in advance!

#1
SHELL

Runs a DOS shell or Windows Program Manager (CTRL-F10), and a DOS program if one is specified (ALT-F10).

Syntax

SHELL [cmd [NOWAIT]]
cmd
A command to execute the desired DOS or Windows program. If a command is not specified, the DOS shell or DOSPRMPT.PIF is executed.
NOWAIT
Causes the script file to continue execution while the specified program is running. The default behavior of the SHELL command with a DOS command parameter is to pause execution of the script file until the DOS program terminates.

Examples

SHELL SORT.EXE MS92FILE > SORTFILE NOWAIT
In this example, the script runs a DOS shell that performs a DOS sort. The script continues execution while the sort is running.
SHELL EDIT.COM
In this example, the script runs the DOS editor. The script PAUSES execution until the user exits from the editor.

Related Commands

To run a DOS shell that does not need the "nowait" parameter to leave script execution uninterrupted, use RUN.

#2
RUN

Runs a DOS shell or Windows Program Manager (CTRL-F10), and a DOS program, if one is specified. The script file continues to execute while the specified program is running.

Syntax

RUN [cmd]

cmd
A command to execute the desired DOS or Windows program. If a command is not specified, the DOS shell or DOSPRMPT.PIF is executed.

Example

SHELL EDIT.COM
In this example, the script runs the DOS editor. The script does not pause execution while the editor is running.

Related Commands

To run a DOS shell that causes the script to pause until the DOS program is finished, use SHELL with the "nowait" parameter.do you really want to delete the first line of a specified text file, or just ignore it?
use the for loop with the skip token . check for /? for more informationQuote from: Dias de verano on February 24, 2008, 02:31:43 AM

do you really want to delete the first line of a specified text file, or just ignore it?


I wan't to delete it...another application reads the file to a variable but it can only store up to 80 CHARACTERS, and it's always the first 80, I can't search for text or anything like that...So after every record is read and the corresponding function is completed I want that record deleted so that the application can read the next record. Thanks for helping me out!


Discussion

No Comment Found