Notifications
Clear all

[Closed] Write quoted string to file?

 em3

Hi, I need to write out a string to a text file that looks something like this: UID=“1234”

my variables look like this:


 	txt9="UID=" 
 	txt10=$.name

if I use print I get “UID=1234”
or
if I use format I get UID=1234

I need UID=“1234”

How can I accomplish this? Thanks!

6 Replies

theString = “UID=” + “”” + “1234” + “””

txt10 = “””+$.name+”””

-Eric

 em3

thanks guys, that works great!

One last thing, I need to save the filename as

f = (createFile "c://" + $.name + ".txt")

Seems like that should work but does not.

If you get an error, its because you need to put your argument into (), like this:


f = (createFile ("c://" + $.name + ".txt"))
                ^                        ^

 j83

(
	local ourFileName = (createFile ("c:/" + selection[1].name + ".txt"))
)

 em3

thanks guys! This also works:

out_name = "c://" + $.name + ".txt"
	outfile = (createFile out_name)