Jump to content

Recommended Posts

Posted

Hello everyone

Could you please help me?

I want to write the sign " to text file

I tried this below code, but it can't add this sing to text file

what's wrong?

 

Below are the text file I need to add to text file

 

 

Below are my code

 

(setq f (open (strcat "c:\\LLMS CAD\\filename.txt") "a"))

(setq txt1 "")

(write-line txt1 f)

(close f)

(princ)

)

 

Below are text in put to file

 

Posted (edited)

Use \" for writing " in any argument. See my example... Same way you can use it in writing arguments

 

e.g.

(princ "\" Hello \"")
-> " Hello "

 

Your code

(setq txt1
      (strcat
 "<?xml version=\"\"1.0\"\" encoding=\"\"UTF-8\"\"?><kml xmlns=\"\"http://www.opengis.net/kml/2.2\"\" xmlns:gx=\"\"http://www.google.com/kml/ext/2.2\"\" xmlns:kml=\"\"http://www.opengis.net/kml/2.2\"\" xmlns:atom=\"\"http://www.w3.org/2005/Atom\"\"><Document><name>"
      )
)

Edited by satishrajdev
Posted

test this below

(alert "and then I said, \"test this below\"")

Posted

Thank you very much satishrajdev and Lt Dan's legs

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...