Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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.

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

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |