mit 发表于 2022-7-5 18:33:13

将“添加到文本文件”

大家好
你能帮帮我吗?
我想把符号写在文本文件中
我尝试了下面的代码,但它无法将此sing添加到文本文件中
怎么了?
 
下面是我需要添加到文本文件的文本文件
 
 
下面是我的代码
 
(setq f(打开(strcat“c:\\LLMS CAD\\filename.txt”)“a”)
(setq txt1“”)
(写入行txt1 f)
(关闭f)
(普林斯)
)
 
以下是文件中的文本
 

satishrajdev 发表于 2022-7-5 18:48:26

在任何论点中使用“for write”。看我的例子。。。用同样的方法写论点
 
例如

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


 
您的代码

(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>"
      )
)

Lt Dan's l 发表于 2022-7-5 19:02:58

在下面进行测试
(alert "and then I said, \"test this below\"")

mit 发表于 2022-7-5 19:08:34

非常感谢satishrajdev和Dan中尉的腿

Lee Mac 发表于 2022-7-5 19:15:19

下面是有关转义字符的更多信息。

mit 发表于 2022-7-5 19:25:41

非常感谢李·麦克

Lee Mac 发表于 2022-7-5 19:40:06

不客气!
页: [1]
查看完整版本: 将“添加到文本文件”