Macro - Another multiple-replace problem

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

FrogSpawn
Posts: 7
Joined: Sun Dec 21, 2003 6:33 am

Post by FrogSpawn »

Bob Hansen wrote:Reminder: It may be my macro, but it is using your original RegExexpressions.
Indeed, but at least it seems less likely that there's anything about how I've recorded it that is affecting the outcome.
Again, I think your Regex should probably be modified to deal with the trailing spaces.
I think you're forgetting that the replace operations work:
- when performed manually
- when recorded as two separate macros (with the last replace recorded and executed separately)
- (re the last replace) when performed manually on the improperly re-formatted text after executing the macro

Also if you examine the expressions used, the only place where a trailing space is of any consequence (in the source text) is in the NAMEX lines - and that's not a problem in my source text nor in the test text (once they've been removed - easy enough to do for a couple of lines). Also, take a look at those regexes - I can't see how what you're suggesting can be done. The last replace is searching for that specific string: a single uppercase followed by a sequence of lowercase followed by a colon and space. Where's the relationship between that and a trailing space on the very last line of text?
I don't think it is a bug,
I'd really like for you to try it out as per my previous post. Then tell me if you're not absolutely surprised that the macro fails to work because of a single trailing space on the last line and witness that removing it allows the macro to work (combined with the fact that after the macro has failed, executing the final replace manually *does* work). I was flabbergasted when I saw that - just adding and removing that trailing space makes all the difference.
and I don't think it is OS sensitive.
Well at least I can agree with you on that! :)
But you are closer to the source data and can work that out better than remote forum users with sample code.
As i pointed out in my last post, the only requisite in using the posted sample text is to remove any trailing spaces from the NAMEX lines. Once that's done then you only need play with the last line by adding and removing the trailing space on it and/or a trailing blank line. Try it then look at those expressions and tell me I'm missing something? (And again - when the macro fails, do that last replace manually and see how it works, then tell me *why* it works manually - or even when recorded as a separate macro - but won't work as part of the original macro). And then tell me again why you think it's not a bug? :)

Thanks for the other info.


fs
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Okay, I will try to get back to this soon.

Maybe some others will also have some input to help you out.
Hope this was helpful.............good luck,
Bob
Post Reply