关于“Mtext”仅获取文本a
选取“多行文字”,仅获取文字和换行符(\P),过滤掉其他属性。怎么做? 谢谢大家!给我一个主意, 未格式化字符串
谢谢李,看你喜欢看救世主!但我无法打开此链接。
未格式化字符串 如果没有太复杂的多行文字,也可以使用:
(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”
非常感谢你!李
非常感谢Costin,
页:
[1]