Computing.Net > Forums > Windows 95/98 > Auto edit using Batch file?

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.

Auto edit using Batch file?

Reply to Message Icon

Name: Walnut
Date: July 14, 2003 at 14:04:51 Pacific
OS: win 98se
CPU/Ram: 233/80mb
Comment:

Hi all!!

Is there a way to use a batch file to edit another file without user intervention?

For example, could I use a bat file with find and edit to remove a selected line or word within another text based file?

I can easily use a batch file to open edit for a specific file but I have to type in any alterations manually.


Any help is appreciated!




Sponsored Link
Ads by Google

Response Number 1
Name: TechQuest
Date: July 14, 2003 at 14:16:52 Pacific
Reply:

I know that with BATCH files you can add certain lines but I don't know about taking out lines. I'm more skilled in Visual Basic than in Batch. Batch isn't really programming but more of a bunch of DOS commands. I know you can use the "copy" command to add to files but you have to make a file to add a file.
For example: If you wanted to add all the config.sys information to autoexec.bat (GOD ONLY KNOWS WHY :S)

copy config.sys + autoexec.bat newfile.dat

It will create a newfile called newfile.dat and it will look something like this:

DEVICE=HIMEM.SYS
FILE=99
LASTDRIVE=Z
SET BLASTER=A220 I7 D3 T4
LH C:\WINDOWS\ASP4DOS.COM

Whereas the top 3 lines are from config.sys and the bottom 2 are from autoexec.bat. It basically just places the first file on top of the other.

TechQuest

PS. Probably didn't help much but just as well, it might have :S.


0

Response Number 2
Name: Derek
Date: July 14, 2003 at 16:53:38 Pacific
Reply:

I don't know a way to do this either, but:

If you just want to get shot of new lines that appear in an existing file, you can make a copy of the file in the form you want it, then use a batch file to copy this over to the original to restore the required situation when required.

Again not too much help, but it might aid the thought process on whatever it is you are trying to do.

Derek


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 Windows 95/98 Forum Home


Sponsored links

Ads by Google


Results for: Auto edit using Batch file?

A prog that auto writes a batch file? www.computing.net/answers/windows-95/a-prog-that-auto-writes-a-batch-file/48065.html

Joining MPEG files using Batch File www.computing.net/answers/windows-95/joining-mpeg-files-using-batch-file/31898.html

Inserting text using batch files... www.computing.net/answers/windows-95/inserting-text-using-batch-files/78975.html