Computing.Net > Forums > Programming > GSAR to find and replace

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.

GSAR to find and replace

Reply to Message Icon

Name: AJ (by William Jimenez)
Date: October 29, 2008 at 06:59:42 Pacific
OS: Windows XP
CPU/Ram: Dell
Comment:

Does any one know how to use GSAR to search and replace a string with spaces?

Say I want to look for the string STRING and I want to replace it with MY STRING. Now I know this is easy GSAR -sSTRING -r"MY STRING" IN_FILE.BAT

GSAR uses quotes for strings with spaces but what if I need the quotes to remain for example in a batch file where the string to be replaced needs to be in quotes like "My Documents"

Say I have the following command

Robocopy F:\SourceFolder C:\MyFolder /S /XD "ONE FOLDER"

This would tell Robocopy to copy F:\SourceFolder with all of it subfolders to C:\MyFolder and by usind the switch /XD to exclude the "One Folder" which needs to stay in quotes other wise robocopy will think it is two folders One and Folder.

I can't enclose it in two double quotes """" I've tried that.

Any help is appreciated.



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: October 29, 2008 at 08:37:58 Pacific
Reply:

I tried to get GSAR, but their link pooped out.

There are other utils you can use.


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

M2


0
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: GSAR to find and replace

Find and Replace text in Batch File www.computing.net/answers/programming/find-and-replace-text-in-batch-file/12413.html

CMD script find and replace text www.computing.net/answers/programming/cmd-script-find-and-replace-text/15412.html

find and replace string in a file www.computing.net/answers/programming/find-and-replace-string-in-a-file/19987.html