mit Posted October 6, 2015 Posted October 6, 2015 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 Quote
satishrajdev Posted October 6, 2015 Posted October 6, 2015 (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 October 7, 2015 by satishrajdev Quote
Lt Dan's legs Posted October 6, 2015 Posted October 6, 2015 test this below (alert "and then I said, \"test this below\"") Quote
mit Posted October 6, 2015 Author Posted October 6, 2015 Thank you very much satishrajdev and Lt Dan's legs Quote
Lee Mac Posted October 6, 2015 Posted October 6, 2015 Here is more information regarding Escape Characters. Quote
Recommended Posts
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.