CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.096.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator. New AutoCAD 2026 commands and variables.

CAD tip CAD tip # 4136:

Question

CAD 
 %  platform  category 
A
Use the LISP application by CAD Studio (ARKANCE) - srxText (see DL Download) to add digit-triplets separators to existing drawing texts/figures. Use the Regular expression option of the text replacement command.

The search/replace expression for thousands separator (",") can be e.g.:

-?\([0-9]+\)\([0-9][0-9][0-9]\)
\1,\2
You may need to repeat this for millions etc. (srxText can be scripted). It will change:
1234 -> 1,234
-1234.5 -> -1,234.5

Update: the newer version of the command - SRXTEXT2 - has easier, VBscript-like formatting of the control codes.

For this thousands separator task, you can use the following, more flexible search/replace code:

(\d)(?=(\d{3})+\b)
$1,

Load the VLX file with APPLOAD and type SRXTEXT. See Readme for other examples of complex text replacements.

ACADADTMapACADMMDT
100% *CAD
23.11.2004    15135×   FAQ  

See also:
Tip 14163:How to select DWG texts containing a certain number of characters?
Tip 13831:ReplMTcol - recoloring parts of text in paragraph Mtext.
Tip 13139:How to insert a new line into multiline text in the Find/Replace command?
Tip 12803:How to add double line-spacing to AutoCAD paragraphs?
Tip 9265:RENAME on steroids - complex renaming of AutoCAD objects (blocks, layers...)


Back    All CAD Tips



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, or donating via PayPal (see above). 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
  



Featuring:
Add .CIT raster format support to AutoCAD and Map and Civil 3D
CITin More info


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