liuhaixin88 发表于 2022-7-5 23:13:12

关于“Mtext”仅获取文本a

选取“多行文字”,仅获取文字和换行符(\P),过滤掉其他属性。
 
怎么做?

liuhaixin88 发表于 2022-7-5 23:26:13

谢谢大家!给我一个主意,

Lee Mac 发表于 2022-7-5 23:32:00

未格式化字符串

liuhaixin88 发表于 2022-7-5 23:45:34

 
谢谢李,看你喜欢看救世主!但我无法打开此链接。

Lee Mac 发表于 2022-7-5 23:52:52

 
未格式化字符串

Costinbos77 发表于 2022-7-6 00:01:57

如果没有太复杂的多行文字,也可以使用:
 

(setq cTxt "{\\fArial|b1|i0|c0|p34;\\L{\\H0.7x;\\C4;\\S2#3;}\\O\\KA\\C3;b\t\\l\\o\\k\\C5;c}d {\\C5;;} E%%C{\\L\\O\\K\\C1;fg\\C256;h\\P \\fISOCPEUR|b0|i0|c0|p34;\\C6;\U+2220 z\\l\\o\\k\\C256; x} {\\H0.7x;\\C4;\\S1#2;}")

(foreach e '(("\\K" "") ("\\L" "") ("\\O" "") ("\\P" "\n") ("\\S" "") ("\\k" "") ("\\l" "") ("\\o" "") ("\\p" "\n") ("{" "") ("}" "") ("\\U" "§") )
(setq cV (car e)cN (cadr e) ) ;_ end of setq
(while (setq pS (vl-String-Search cV cTxt)) (setq cTxt (vl-String-Subst cN cV cTxt)) (if (= cV "\\S") (setq cTxt (vl-String-Subst "" ";" (vl-String-Subst "/" "#" cTxt) pS)) ) ) ;_ end of wh
) ;_ end of f

(while (and (setq pS (vl-String-Search "\\" cTxt pS)) (setq pE (vl-String-Search ";" cTxt pS)) )
(setq cTxt (vl-String-Subst "" (substr cTxt (1+ pS) (1+ (- pE pS))) cTxt) ) ;_ end of setq
) ;_ end of wh pS
(while (vl-String-Search "§" cTxt) (setq cTxt (vl-String-Subst "\\U" "§" cTxt)) ) ;_ end of wh



 
cTxt=“2/3Ab\tcd;E%%Cfgh\n\U+2220z x 1/2”

liuhaixin88 发表于 2022-7-6 00:08:08

 
非常感谢你!李

liuhaixin88 发表于 2022-7-6 00:15:40

 
非常感谢Costin,
页: [1]
查看完整版本: 关于“Mtext”仅获取文本a