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 CLOSED
 
Thread Tools Search this Thread Display Modes
Old 11 November 2003   #1
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?

Thanks!

Sean Looper
 
Old 11 November 2003   #2
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?

Sean
 
Old 11 November 2003   #3
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!

Sean

Last edited by slooper : 11 November 2003 at 07:39 PM.
 
Old 01 January 2006   #4
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.
 
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 04:29 PM.


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