Jump to content

Batch Find & Replace Text


Lee Mac

Recommended Posts

Thanks for your post, I completely understand where you are coming from and have experienced those who just want the code handed to them on a plate many times.

 

I do offer small subfunctions to point users in the right direction, but the problem I face is that I get frustrated when I have the solution written, but don't want to just hand it out - as this opens the door for leeches... As far as the bigger programs are concerned, its a bit of a catch22 situation, as many of these programs would not be at the stage of development that they are today without the ideas, input and testing of the forum members, but of course, as soon as they are posted as freeware your point applies.

 

I would love to set up my own site and perhaps sell some of my programs, but I haven't got around to setting a site up as yet, and furthermore doubt if the revenue gained from selling the programs would even cover the sites running costs - I mean, there are others also willing to offer free programs online and so why would people pay for mine...

 

I definitely think .NET is the way to go - and I seriously need to think about making some headway into learning it; I find it all too easy to slip back into the comfortable and easy realm of LISP. I've downloaded the MSoft VS C# Express Edition 2010 to perhaps get me started (running AutoCAD 2010) and will hopefully try to find some time to get going with it.

 

And don't worry, I haven't taken any offence from what you are saying, I completely understand where you are coming from.

 

Lee

Link to comment
Share on other sites

  • 2 weeks later...

Dear Lee,

I just discovered that you wonderfull program saves all processed file in 2010 format. My clients, who use earler releases of AutoCAD, started complaining that my files would not open for them. And my software is set to alway save back to 2004 format. I stated checking, and found the reason: all the files I've run BFIND on are affected. Tested it again to be sure.

Is there any way to fix this? Ideally, the save-as vesion would available on the Options dialg box. If that's too complicated, how about checking the current default seve-as format and matching it?

 

Zoya

Link to comment
Share on other sites

Hi Zoya,

 

I think this has been discussed earlier in the thread, and I don't think this is possile with the use of ObjectDBX (which is what the program runs on).

 

Apologies,

 

Lee

Link to comment
Share on other sites

Hi Lee,

 

Love this program so far - but I'm having one small issue - downloaded v1.4 but it looks like the Options dialog doesn't have the features that you added in v1.3. ie: the only options are:

- Ignore Objects on Locked Layers checkbox

- Objects to Search checkboxes

 

Am I missing something or doing something wrong?

 

Edit: Also having some problems finding / replacing text in general. It seems as though some strings work while others are ignored, with no logical pattern (that I can detect). Similar characters, nothing fancy, just alphanumeric and dashes. Also - if I replace a string and then try to change it back, the program won't do it. Is it possible that I downloaded a flawed copy of the program? I've re-downloaded it and tried it with the same results. Any tips you can offer would be appreciated!

 

Thanks!

 

selder

Edited by selder
Link to comment
Share on other sites

Hi Selder,

 

I would warn that the program does have a lot of bugs still, and I have only kept it up due to popular demand.

 

With reference to the 'missing' features, I completely changed the engine that performs the replacement to one that uses Regular Expressions and am still ironing out bugs with MText formatting when performing standard replacements - before I incorporate those other features.

 

Of course, the easiest thing I could have done would be to use the old replacement system and disallow MText (due to the nasty formatting codes within the string), but this limits the scope of the program immensely.

 

I'm not sure about the problems you are having with some strings working while others don't, but as I say, there are a lot of bugs still to be addressed.

 

As for the undo, this is nigh impossible for a batch process using ObjectDBX hence I would always advise to use the program on copies of drawings.

 

Lee

Link to comment
Share on other sites

Hi Lee,

 

Ok - I didn't pick up on the fact that the engine change required some functions to be scaled back, but that makes perfect sense.

 

I wasn't trying to undo, per se - I was trying to 'manually' undo, ie: run the tool on a find/replace pair of strings, then reverse the two strings in the BFind dialog and run it on the same strings, but in the reverse order. Shouldn't that be possible?

 

And that's some good, solid advice on running the program on copies of drawings. It's obvious, yet it bears repeating, loudly and often.

 

Thanks

selder

Link to comment
Share on other sites

I wasn't trying to undo, per se - I was trying to 'manually' undo, ie: run the tool on a find/replace pair of strings, then reverse the two strings in the BFind dialog and run it on the same strings, but in the reverse order. Shouldn't that be possible?

 

I see - that should definitely be possible, I'm not sure why that would go wrong unless the replacement string contained non-standard characters which may interfere with the regular expressions being used to strip any MText formatting.

 

And that's some good, solid advice on running the program on copies of drawings. It's obvious, yet it bears repeating, loudly and often.

 

Definitely - I would reiterate that for any program that uses a batch process.

Link to comment
Share on other sites

I see - that should definitely be possible, I'm not sure why that would go wrong unless the replacement string contained non-standard characters which may interfere with the regular expressions being used to strip any MText formatting.

 

Not as far as I can tell - just alphanumerics in this case.

Link to comment
Share on other sites

  • 4 weeks later...
Updated code to latest version.

 

 

Hello Lee,

 

Bfind is not working for me. Do you have any idea why?

 

I'm using Autocad 2011. Loading the file works normally and I can pop up the bfind window. I can set 2 strings and press OK and it seems to be opening and closing all the different files but no Strings are being replaced.

 

Any ideas? All the objects for search are enabled.

 

Thanks

Link to comment
Share on other sites

I just checked and it seems that it works but doesn't go inside the block references searching for the titles there. I keep on playing around with it. Thanks.

Link to comment
Share on other sites

See the options section for objects to search. It will not alter block definitions.

 

Actually it seems to be a problem in my case with the letter "s".

 

What I did was I tried substituing the letter "s" with "test" and the word "Surge" didn't change. However I tried each other letter, first "u" and it became "Stestrge" and then "r" and it became "Sutestge" and so forth all the way to letter "e".

 

I don't know what is going on in my case.

Link to comment
Share on other sites

The "S" sure seems like it has to do with it.

 

I tried using "24VPOS" for "TEST Alex" nothing happens but when I go

"24VPO" for "TEST Alex" It goes 24VPOTEST AlexS"

 

The "S" has to have something to do with it.

 

any ideas?

Link to comment
Share on other sites

Actually it seems to be a problem in my case with the letter "s".

 

What I did was I tried substituing the letter "s" with "test" and the word "Surge" didn't change. However I tried each other letter, first "u" and it became "Stestrge" and then "r" and it became "Sutestge" and so forth all the way to letter "e".

 

I don't know what is going on in my case.

 

Bear in mind that 'Match Case' may be checked in the Options dialog.

Link to comment
Share on other sites

Bear in mind that 'Match Case' may be checked in the Options dialog.

 

 

Hello Lee, I just noticed that the issue is only with capital S. I tried with lower case "s" and it works. I then tried with lower case"a" and it works and then with capital "A" and it works as well. I also tried both for different letters and they worked as well.

 

What the heck is going on. I guess it has to be some configuration on Autocad or something.

 

By the way the only thing I found in the options dialog was check box for the following options:

 

ignore objects on locked layers

objects to search (single-line text, multiline text, block attributes, dimension text, multileader text, table text)

 

Where do I find the case sensitive? Would that be in the logic itself?

 

Thanks

 

Alex

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...