Help: Maxscript for Find/Replace in .bat file

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  11 November 2003
Question Help: Maxscript for Find/Replace in .bat file

I would like to take a .bat file and have a maxscript that goes through the entire file and replaces all the back slashes "\" with forward slashes "/"

Does anyone know if this is possible, and how?


Sean Looper
  11 November 2003
actually, if it's easier (and cleaner) all I really need is a function that takes a string and replaces the f-slashes with b-slashes. Kinda like this:

s = "dav/id"
r = s.count
for i = 1 to r do
if s[r] == "/" then
s = replace s r 1 "\\"
print s

this should return "dav\id" an I right? But it doesn't. Can someone please tell me what I might be doing wrong?

  11 November 2003
ok nevermind lol I answered my own question...

this line:

s = replace s r 1 "\\"

should read:

s = replace s i 1 "\\"

and this line:

if s[r] == "/" then

should read:

if s[i] == "/" then

Glad I could share this learning experience with you all!


Last edited by slooper : 11 November 2003 at 07:39 PM.
  01 January 2006
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 06:00 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.