Display full version of the post: Faster way of formatting text to particular format

z1990m
25.05.2018, 22:46
Hi,This is probably trivial for most people but I’m strugging to invent a work around for lots of typing and mouse clicks.What I have is a survey drawing unedited with multiple text displaying depths in the format of “0.00d”However the survey software spits out these filths in all different formats e.g. “.0” “0.0” “.00”What I currently do as my fastest way to rectify this is do multiple QSELECT commands each time using wildcards like #.# or .# and using a lisp command that I found on the net to add prefixes and suffixes in order to format all the text to read “#.##d” What I originally thought was to record a macro of me running all of these QSELECT commands and save that, problem being it grinds to a halt once the QSELECT dialog box gets involved.Hopefully that made sense to someone, and if someone could help it would save me so much time.Thanks

Kent Cooper
30.05.2018, 15:17

Do all of them always end with a "d" and never have any other content except the decimal-numerical part?  If so, it shouldn't be hard to make a routine that would "fix" such text content.Kent Cooper2018-05-30 15:18:53

z1990m
30.05.2018, 19:01
Kent,To be honest, no they don’t as I could use the lisp I have to add the “d” (depth in case you where wondering) as a suffix at the end. Mainly just trying to speed up my prep time before finalising my drawings as the survey software we use spits out some less than ideal formats for this text.If you could help then it would be very much appreciated! ??Zak

Vladimir Michl
03.06.2018, 08:24
 I think it should be possible to use srxText (a general text replacement utility, see Download) and find a regular expression which would cover all wrong formats, and replace it then with the right one.If you send me a list of all possible wrong formats, I can help to code such expression.

bigdave34
18.07.2018, 14:35

Hi wondering if you can help me using srxtext command? I want to replace a KKS code prefix, the code is alphanumeric so currently something like 3HAD10#### is the start can be any combination of letters though, just want to change the 3 to 1. Any ideas? Thanks
bigdave342018-07-18 14:36:22