Originally Posted by
brahmanandam.thadikonda762224
Dear All,
I need a lisp that extract numbers seperately from selected texts.
CASE1 (Remove all Alphabets) : I need a lisp that can remove all the alphabets from selected texts For example the "Motor 125 kW" text is there in autocad. I need to get the return value "125" only, that should replace the original one.
CASE2: (Remove Prefix Alphabets) : I need a lisp that can remove all the prefix alphabets from selected texts. For example the "Motor 125 kW" text is there in autocad. I need to get the return value "125 kW" only, that should replace the original one.
CASE3: (Remove suffix Alphabets) : I need a lisp that can remove all the suffix alphabets from selected texts. For example the "Motor 125 kW" text is there in autocad. I need to get the return value "Motor 125" only, that should replace the original one.
Thanks in advance,
T.Brahmanandam.
I use :
Code:
(defun ripcar (s)
(vl-list->string (vl-remove-if '(lambda(x)(or (< x 48)(> x 57)))(vl-string->list s))))
(defun ripnum (s)
(vl-list->string (vl-remove-if '(lambda(x)(and (< x 58)(> x 47)))(vl-string->list s))))
gr. Fikkie