471,825 Members | 1,206 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,825 software developers and data experts.

can't search and replace

Hi,

Can anyone help? I try search the keyword from _V and replace _VDR at the create.bat file and use below perl command but it doesn't work.

perl -pi -i.bak -e 's/_V/_VDR/' create.bat


After execute the above command and all _V not change to _VDR :
rmtshare \\NASP01\GRP_NetwrkOps = "c:\vol\IA01_V001\GRP_NetwrkOps" /REMARK:"Network Operation"


Best regards,

Chung
Feb 7 '08 #1
5 1349
KevinADC
4,059 Expert 2GB
try removing the i that is right after p in the oneliner you posted and add the "g" modifier to the regexp:

Expand|Select|Wrap|Line Numbers
  1. perl -p -i.bak -e 's/_V/_VDR/g' create.bat
make sure to use the full path to create.bat if necessary
Feb 7 '08 #2
Hi KevinADC,

Thanks your reply, but it still not change after try your solution.


Best regards,

Chung
Feb 7 '08 #3
KevinADC
4,059 Expert 2GB
Works for me. Don't know what to tell you.
Feb 7 '08 #4
Hi KevinADC,

I don't install perl at windows and just only Perl300.dll, Perl.exe and PerlMsg.dll files. Is any missing? Thanks.


Best regards,

Chung
Feb 7 '08 #5
KevinADC
4,059 Expert 2GB
Hi KevinADC,

I don't install perl at windows and just only Perl300.dll, Perl.exe and PerlMsg.dll files. Is any missing? Thanks.


Best regards,

Chung
As far as I know you need to install perl. I do not know what perl300.dll is or PerlMsg.dll. perl.exe looks like the main perl executable but there are many other files that come with perl.
Feb 7 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Jane Doe | last post: by
22 posts views Thread by Phlip | last post: by
1 post views Thread by Tomomichi Amano | last post: by
6 posts views Thread by DataSmash | last post: by
14 posts views Thread by Simon Gare | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.