Computing.Net > Forums > Programming > search and replace in DOS

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.

search and replace in DOS

Reply to Message Icon

Name: anaik100
Date: November 15, 2006 at 13:32:03 Pacific
OS: DOS
CPU/Ram: Intel
Product: DELL
Comment:

Hi,

I am writing a batch script. i need to perform below tasks
1. Opening a file. searching a specific string(more then one letter) and replacing it with another string(more then on letter)
I checked in this forum. The solution was mentioned that we should use FOR command of DOS. But i am not able to do it. Can anybody please provide me the exact syntax

1. Once step1 is compelted i want to execute a dos command through my batch script. How do i do it?

thanks in advance



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: November 15, 2006 at 13:56:46 Pacific
Reply:

To replace strings while searching through a text can be performed by scripting, but that requires advanced techniques which seem to be far beyond your actual experience.

First of all specify your operating system *exactly* as Windows XP/2K/NT and Windows 9X/ME belong to absolutely different families of products despite their common commercial logo (Windows). By the way XP/2K/NT doesn't have DOS, only an emulator (NTVDM).

I can't believe you are running real plain DOS: as it is, forget to achieve your target by the poor capabilities of classic DOS scripting (FOR is NT batch statement).

So stated you can find a short tutorial about FOR typing at prompt FOR /?, but again FOR in NT systems is more powerfull than its counterpart in DOS.

Think about what I posted and take your decision about going onto that lane.

Don't blame me... I'm an old, boring guy.


0

Response Number 2
Name: Mechanix2Go
Date: November 15, 2006 at 16:12:35 Pacific
Reply:

To do it in DOS, you need a 3rd party utility like:

Change


It works on text files up to about 30KB.


=====================================
If at first you don't succeed, you're about average.

M2



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 Programming Forum Home


Sponsored links

Ads by Google


Results for: search and replace in DOS

Perl search and replace www.computing.net/answers/programming/perl-search-and-replace/14586.html

Batch: Search Replace in Variables www.computing.net/answers/programming/batch-search-replace-in-variables/14057.html

Search and replace empty spaces in www.computing.net/answers/programming/search-and-replace-empty-spaces-in-/16845.html