Cesky English Deutsch
Login/Register:
 Visitors: 1568 
Become a fan of CADforum on Facebook
Follow us on Twitter
WWW server of the XANADU company (formerly: CAD Studio)

CAD tip CAD tip # 3714:

Question CAD 
 %  platform  category 
Q - question

How to replace only a single occurrence of a substring in a drawing text?

A - answer You can use the srxText LISP utility and regular expressions to replace only the first occurrence of a substring - e.g.:

search: \(.\)oldtext\(.\)
replace: \1newtext\2

will change

myoldtext1andoldtext2 -> mynewtext1andodltext2
For srxText see www.xanadu.cz/developuk
ACADADTMDTMap
100% *  CAD 
6.4.2004    3337x  
Comments   Tell a friend

See also:
Tip 7241:Searching text in DWG drawings (without AutoCAD).
Tip 4136:How to add thousands separators in AutoCAD numbers?
Tip 3894:How to replace hard returns (EOL) in MText?
Tip 3628:Using the FIND command in scripts, with no dialog.
Tip 3229:How to replace texts in many AutoCAD drawings? (regular expressions)


Back   All CAD Tips All CAD tips&tricks

Where is the 'convert polyline to wall' command in Architectural Desktop 2004 and 2005? « | » Font style does not offer Italic or Bold style.

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings. You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   



Featuring:
Need easy intranet document management? Try iPROJECT More info


Please use these tips at your own risk.
XANADU (CAD Studio) is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist