Organic Posted March 8, 2015 Share Posted March 8, 2015 I have about 10,000 pieces of individual text items (some is text, some is mtext) containing numbers that each are similar to the format "88XXX.XXX" where X is other numbers. I want to remove the two leading characters ('88' in this case) off of all pieces of selected text. I tried to do this with find/replace however some strings contain numbers such as 88562.881" where find/replace with '88*' as the find parameter and nothing as the replace parameter will then make the text to be 562.1 when I need the text to be 562.881. Am I just using find/replace and wildcards wrongly or does anyone know of an alternative way I could make this work? Cheers. Quote Link to comment Share on other sites More sharing options...
Dana W Posted March 9, 2015 Share Posted March 9, 2015 (edited) Is there a space in front of the 88? If so, include it in the find. If there is no space, um well I'm not sure either, yet. A space is a locatable character. If the number is the only thing on the text item without a leading space it won't work, but if there is you can use the space. Edited March 9, 2015 by Dana W Quote Link to comment Share on other sites More sharing options...
Dadgad Posted March 9, 2015 Share Posted March 9, 2015 (edited) I suggest you check out this gem from Lee Mac http://www.lee-mac.com/bfind.html It will do just about anything you ask it to, and as we (his long time benefactors/fan base) have come to expect, with Lee's brilliant lisps, will save you an incredible amount of time and effort. Thanks Lee! Edited March 9, 2015 by Dadgad Quote Link to comment Share on other sites More sharing options...
Organic Posted March 9, 2015 Author Share Posted March 9, 2015 Is there a space in front of the 88? If so, include it in the find. If there is no space, um well I'm not sure either, yet. A space is a locatable character. If the number is the only thing on the text item without a leading space it won't work, but if there is you can use the space. No space infront. I suggest you check out this gem from Lee Mac http://www.lee-mac.com/bfind.html It will do just about anything you ask it to, and as we (his long time benefactors/fan base) have come to expect, with Lee's brilliant lisps, will save you an incredible amount of time and effort. Thanks Lee! Thanks, I found I already had that lisp installed However it seems to do the same as the default AutoCad find/replace and I can't see any extra functionality that works for this specific case? Quote Link to comment Share on other sites More sharing options...
steven-g Posted March 9, 2015 Share Posted March 9, 2015 How about '88***.' if you include the decimal point it is unlikely to find text with two decimal points ! you might want to run it a couple of times if you have to deal with larger or smaller numbers. Quote Link to comment Share on other sites More sharing options...
Organic Posted March 9, 2015 Author Share Posted March 9, 2015 How about '88***.' if you include the decimal point it is unlikely to find text with two decimal points ! you might want to run it a couple of times if you have to deal with larger or smaller numbers. For the example piece of text "88125.881" Find "88***." and replace with "" (i.e. nothing) gives the result "881" Find "88***." and replace with "***.*" gives the result "***.*881". I.e. asterisks are actually added to the text. It doesn't seem to work like the rename function unfortunately (where wildcards do work well). Quote Link to comment Share on other sites More sharing options...
steven-g Posted March 9, 2015 Share Posted March 9, 2015 I keep going back to this, ridiculous, there is no way to get it to leave the wildcard sections as the original, when you do a replace. Quote Link to comment Share on other sites More sharing options...
Organic Posted March 9, 2015 Author Share Posted March 9, 2015 I keep going back to this, ridiculous, there is no way to get it to leave the wildcard sections as the original, when you do a replace. I found/modified a lisp that sort of does what I want by removing the first character of the text items. Then just running the lisp a second time to remove the second character. Thread on that here: http://www.cadtutor.net/forum/showthread.php?91296-Basic-lisp-help-with-str-manipulation&p=625013#post625013 It does seem a bit ridiculous although I presumed it was more just me failing at using wildcards properly. http://forums.augi.com/showthread.php?155351-Using-wild-cards-in-both-find-and-replace[url=http://www.cadtutor.net/forum/showthread.php?91296-Basic-lisp-help-with-str-manipulation&p=625013#post625013][/url] explains the problem better than I do and is exactly the same as what I want to do; unfortunately no solution forthat one either. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.