Notifications
Clear all

[Closed] 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

2 Replies

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

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