[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Problem with from102cr in U2



Well, this is more of a problem with XyWrite than with U2, but the 102cr
frame is supposed to replace all lone line-feeds with the
carriage-return/line-feed pair. To do this it uses a simple search and
replace. But if the last character in the file is a line-feed, it won't get
replaced.
The solution is a bit hairy. You have to find out what the character
immediately preceding the last line-feed is, then do a second CI for
that--e.g., in my file a quote precedes the terminal line-feed, so I use:

ci /"[search-line-feed]/"[cr-lf]/
And that works. But using a wild-x wildcard instead of the literal didn't. So I'd think the U2 frame should be changed to automatically capture the penultimate character, then do a second CI to accomplish the feat.

E.g., with PFUNCs in upper case:

XP BF DF CL DF XD LU BX ci /[search-line-feed]/[cr-lf]/

Haven't tested that, but I think the idea is sound.

Harry Binswanger
hb@xxxxxxxx