Batch find and replace with wildcards

Batch find and replace with wildcards

Anonymous
Not applicable
1,028 Views
9 Replies
Message 1 of 10

Batch find and replace with wildcards

Anonymous
Not applicable

I have projects that repeat the same steps every time I start up. A lot of these steps are find and replace based and can  contain wildcards. I'm having trouble finding the best solution whether it be a script to run find and replace that I can just press play on to run all the different steps I want or if a lisp routine would be best. 

 

Please let me know what the best options available are. 

 

Note: I did try Bfind and it would have worked great if it supported wildcards.

0 Likes
1,029 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable
(defun C:TRC ; = Text Replace for Complete text/mtext strings, pre-defined content
  (/ tss tdata)
  (setq tss (ssget "X" (list (cons 1 "issued for tender"))))
  (repeat (sslength tss)
    (setq
      tdata (entget (ssname tss 0))
      tdata (subst (cons 1 "issued for construction") (assoc 1 tdata) tdata)
    ); end setq
    (entmod tdata)
    (ssdel (ssname tss 0) tss)
  ); end repeat
); end defun

 I have also found this lisp for a predefined find replace. Can someone show me how to add more find replaces to it?

an example of a wild card I'm having trouble with would be Find "###A!###A"  and replace with "!###A"

where number signs are wildcard numbers.

0 Likes
Message 3 of 10

Anonymous
Not applicable

I have projects that repeat the same steps every time I start up. A lot of these steps are find and replace based and can  contain wildcards. I'm having trouble finding the best solution whether it be a script to run find and replace that I can just press play on to run all the different steps I want or if a lisp routine would be best. 

 

Please let me know what the best options available are. 

 

Note: I did try Bfind and it would have worked great if it supported wildcards.

0 Likes
Message 4 of 10

rkmcswain
Mentor
Mentor

So you have variable text on each project/sheet?

 

This is exactly what Sheet Set Manager can solve.

 

 

 

R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 5 of 10

ВeekeeCZ
Consultant
Consultant

THIS is what you need.

0 Likes
Message 6 of 10

Anonymous
Not applicable

It is all single line Mtext.

0 Likes
Message 7 of 10

Anonymous
Not applicable

I'm not sure that will help me I'm mostly looking for a script for find and replaces that can support wildcards.

0 Likes
Message 8 of 10

Valentin_CAD
Mentor
Mentor

Hello,

 

Are you looking for something like this: JTB Batch Change for AutoCAD

 

Also search in the Autodesk App Store



Select the "Mark as Solution" if my post solves your issue or answers your question.

Seleccione "Marcar como solución" si mi publicación resuelve o responde a su pregunta.


Emilio Valentin

0 Likes
Message 9 of 10

Anonymous
Not applicable
Can you give me an example of how I would use this to accomplish the following wild card task?

Find "###A!###A" and replace with "!###A" where number signs are wildcard numbers.
0 Likes
Message 10 of 10

pbejse
Mentor
Mentor

@Anonymous wrote:
Can you give me an example of how I would use this to accomplish the following wild card task?
Find "###A!###A" and replace with "!###A" where number signs are wildcard numbers.

is the replacement an entirely different value or a truncated version of the the target string ?

for example: 

"I'm the the bowery king, 152A!657A of New York" to   

"I'm the the bowery king, !657A of New York" 

or

 "I'm the the bowery king, !234A of New York" <-- entirely different string specified by user prompt?

 

 

 

 

 

0 Likes