Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Is it possible to edit a text file from inside a batch file  (Read 2392 times)

0 Members and 1 Guest are viewing this topic.

bi.tech

  • Guest
Is it possible to edit a text file from inside a batch file
« on: December 13, 2007, 10:19:39 PM »
Hi,
Any ppl out there know how to edit a text file using a batch file.
Say i have a text file abc.text.
I want to open it from a batch file, then add a line of text to it and close it
this operation has to be done by a batch file program.

Thanks in advance
Biju

diablo416

  • Guest
Re: Is it possible to edit a text file from inside a batch file
« Reply #1 on: December 14, 2007, 05:44:31 AM »
echo linetoaddhere >>%folder%\mytxt.txt

that will add a line that says "linetoaddhere" in folder\mytxt.txt
using >> will add to the file , if you were to use a single > it would delete the file first.

vibhor_agarwalin



    Adviser

    Re: Is it possible to edit a text file from inside a batch file
    « Reply #2 on: December 14, 2007, 06:00:13 AM »
    If you need to do quite complex things,

    just call your editor from the batch file
    Vibhor Kumar Agarwal