Author Topic: find and replace text  (Read 6142 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
find and replace text
« on: November 05, 2003, 03:39:19 PM »
hey guys maybe i'm missing something but i've tried and tried to get the find and replace text functions to work but i keep finding text that hasn't been replaced. i've tried to use several other routines like chtxt which does it from the command line but none are working. i am in production and desperately need one that works everytime because i have enough things to check as is. so if anybody has one that works great on any kind of text and allows you to select the match string (optional) that would help me tremendously. thanks

dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
find and replace text
« Reply #1 on: November 05, 2003, 03:44:00 PM »
Quote
one that works great on any kind of text

You might want to be specific here Dan. Are you including blocks in "any kind" ?
TheSwamp.org  (serving the CAD community since 2003)

M-dub

  • Guest
find and replace text
« Reply #2 on: November 05, 2003, 03:50:39 PM »
Dan,
   What version of AutoCAD?
When I'm not using chtext, I have found that the Find & Replace that comes with AutoCAD...2000 and later (?) works very well...

ELOQUINTET

  • Guest
find and replace text
« Reply #3 on: November 05, 2003, 04:42:57 PM »
mark i wouldn't need this to include blocks i usually don't have notes within blocks. i would need this to include dtext, mtext, leader text. i suppose that's it. m-dub i am using adt 3.3 (2002). i'm not sure why but sometimes it works and others no. i go to edit text and copy match string. then go to find/replace and paste it. then i put in new string. sometimes it finds the other occurances sometime not and sometimes it only finds some. i have changed the options numerous times but to no avail. like i say i may be missing something but it just doesn't work efficiently enough for me. so any suggestions are welcome i just want something that i can trust to work everytime. thanks guys

dan

M-dub

  • Guest
find and replace text
« Reply #4 on: November 05, 2003, 05:26:05 PM »
You have to be careful with what you're trying to match.

Sometimes, if you're copying a string of text to paste it somewhere else, it'll also copy the space following the word (or the last word if it's a phrase).  You have to match it exactly.

Also, if you're trying to replace some occurances of the text, but not all, pay close attention to the words surrounding the text you want to change.

ie.  Let's say you want to change all occurances of the word (yes, word) A to the word AN if it preceeds a word beginning with a vowel.  A Apple should be AN Apple

Match Text: A A
Replace With: An A
___________________________________________
I use Find & Replace text quite often and I think we touched on this in the other forum.  I use Excel to create my scripts.  I don't know if anyone else does, but that's just the way I thought would work best for me.  The reason is because when I use Directory Printer to export directory contents to a csv file, it obviously opens in Excel.
  From there, I get rid of the info I don't need, so I'm left with the Path and the files all in column A.
  I then move all of the filenames to column B and copy the path all the way down column A to the last file in column B.  Before doing this, I'll usually FIND C:\Drawings\Path and replace it with Open C:\Drawings\Path.
  Then, in column C, I put in as much of my script as possible (sometimes, more than one is required).  Something simple would be Zoom Extents qsave close.  *One thing to note is that normally, a space acts as an ENTER (which I'm sure the majority of you already figured out ;)) except after the close command, there is no space required.  Actually, if you put the space in, it won't work at all!  I don't know why, but it took a great deal of trial and error to figure this out.
   After this is done and it has been copied down to the last filename, go up to cell D-1 and enter the concatenate function, which would be =CONCATENATE(A1,B1,C1)
   You then fill the series...down to the last filename.  Now, highlight all of column D and copy it to the clipboard (ctrl+c or right click).  Right click on Cell A-1 and select Paste Special.  In the following dialog box, select Values and hit ok.
   You're done...just highlight Columns B thru D (or wherever you ended up) and delete them.
   Save the file as a text file "Text (OS/2 or MS-DOS) (*.txt)"
   Once it's saved, rename it to *.scr and you should be ready to rock and roll.
_____________________________________________

Ok, I have no idea how this frickin' thread turned into a tutorial on creating script files, but at least there is some relevance to Find & Replace there.
If anyone needs any help with their own script file, I'd love to help out.  I realise that's a big IF...I figured scripts have to be one of the easiest forms of code there are!  Anyway, I'm always willing to help out if I can.

Did that answer your question or bring more questions up?!

Sorry  :roll:  :wink:
Mike