Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 01-03-2001, 12:29 PM   #1
Member (8 bit)
 
Join Date: Oct 1999
Location: Bruceville
Posts: 137
Send a message via AIM to shane254
I am trying to compile a small program that will open a text file and edit it and them close it
I am doing all of this in dos and I am wanting to build a batch file to do so

I just cant figure out how to make it edit the file
shane254 is offline   Reply With Quote
Old 01-03-2001, 12:34 PM   #2
SQL nutcase
 
mosquito's Avatar
 
Join Date: Sep 2000
Location: Belgium
Posts: 1,136
Send a message via AIM to mosquito
What do you mean with edit?

If you mean append, you can use
Code:
type some text to append >>test.txt
If not, you have some serious coding to do, its probably easier to look on the web for a tool to do it.
mosquito is offline   Reply With Quote
Old 01-03-2001, 01:08 PM   #3
Member (8 bit)
 
Join Date: Oct 1999
Location: Bruceville
Posts: 137
Send a message via AIM to shane254
I am using this to learn some basic commands in dos

I am trying to open a text file and edit it all in one batch file


like open a text file and tell it to add somde text to the file and the close it is there any way of doing this
shane254 is offline   Reply With Quote
Old 01-04-2001, 03:35 AM   #4
SQL nutcase
 
mosquito's Avatar
 
Join Date: Sep 2000
Location: Belgium
Posts: 1,136
Send a message via AIM to mosquito
the command posted above does this.

when you make a batch file with:
Code:
@echo off
type blablabla >>test.txt
type blablabla >>test.txt
you will see two lines with blablabla in the "test.txt" file. If you want to append text to a file use ">>" If you want to create a new file (or replace a file) use ">" to pipe the text in.

If you want for example the directory listing in a file you can use
Code:
@echo off
dir >> test.txt
now the directory listing of the current directory will be appended to the file.

If you want to see the list of commands you can use in a batch file, type "help" in a dos box. If you want to have info about a specific command, type "help ".

I can recommend this book for shell scripting (be carefull, it's about windows NT shell scripting. This is not the same as shell scripts on Win9x) http://www.newriders.com/books/title...sbn=1578700477


[Edited by mosquito on 01-04-2001 at 03:38 AM]
mosquito is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 08:26 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0