Display full version of the post: modifying text globally

rmmllla
05.03.2011, 03:16
does anyone know of a way to do the following: in a
drawing, there are many text strings containing a numerical value.  i
want to change all the text strings with a single command or series of
commands (without having to individually change them one by one) so that
the original values are retained, but the numbers (numeric text
string) are now enclosed inside parentheses. for example:   123.45  becomes  (123.45),  543.21  becomes  (543.21), 234.56  becomes (234.56), etc.

CarlB
05.03.2011, 07:27
That calls for a lisp routine, or some programming aproach. Don't know of a way just using commands, such as "FIND", which is used for global text modifying.

 
Here's a simple one, that adds a prefix & paretheses to text entities:
http://www.tek-tips.com/viewthread.cfm?qid=812007&page=22
 
Some more robust ones here, but seem to be for just a prefix or suffix, so you have to run it twice-
http://www.cadtutor.net/forum/showthread.php?1608-Lisp-to-add-a-prefix-or-suffix-to-selected-text
 

Vladimir Michl
06.03.2011, 23:06
Our srxText utility can do this (see Download). Use its the "Regular expressions" option and:search text: \([0-9\.]+\)replace text: (\1)