Computing.Net > Forums > Programming > Make a batch file Open a text doc and edit it

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.

Make a batch file Open a text doc and edit it

Reply to Message Icon

Name: webbie
Date: September 24, 2009 at 12:13:50 Pacific
OS: Windows Vista
Subcategory: Batch
Tags: batch, help, Vista
Comment:

Hi guys im trying to make a batch Open a text
doc and edit what it says in it and i need it to
have choices please help



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: September 25, 2009 at 00:39:27 Pacific
Reply:

@echo off > newfile & setLocal enableDELAYedexpansion

set /p old= old txt ?
set /p new= new txt ?

for /f "tokens=* delims= " %%a in (myfile) do (
set str=%%a
set str=!str:%old%=%new%!
>> newfile echo !str!
)


=====================================
Helping others achieve escape felicity

M2


0

Response Number 2
Name: webbie
Date: October 2, 2009 at 14:27:20 Pacific
Reply:

If i give you the names of the folder and the folder location can
you make the coding for me and i make the batch


0

Response Number 3
Name: Mechanix2Go
Date: October 3, 2009 at 06:46:07 Pacific
Reply:

Not quite clear but if the file is not in the same directory as the batch, add this as your second line:

pushd c:\myfiles


=====================================
Helping others achieve escape felicity

M2


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Make a batch file Open a text doc and edit it

editing text file with a batch file www.computing.net/answers/programming/editing-text-file-with-a-batch-file/16828.html

Disable editing a batch file www.computing.net/answers/programming/disable-editing-a-batch-file/16914.html

editing a .ini file with a bat file www.computing.net/answers/programming/editing-a-ini-file-with-a-bat-file/7145.html