I tried moving the sample file over to our v5 box, and trying your
command. It ended up producing a huge block of text from just *before*
the item of interest.

Now that I am back at a computer (albeit a non-iseries variety) I see the
blunder of my ways, and must admit that Scott did, in fact, know what he
was doing. I'd forgotten that the operation in question was a replacement,
and that we did, in fact, want to replace from the start of the line. So
his .* characters were necessary in fact.

This, from my linux system, does exactly what I perceive that you want:

sed -n 's/.*foo="\(.\{20\}\)".*/\1/p' < /tmp/myfootxt

Try that out, please? You may (?) find it much faster than your
home-rolled. Whether it's fast enough... you would have to decide.

If they want this capability to
work from the server as well as from the client, they can bloody well
spend half a minute putting the license key in by hand!

LOL! Your choice, but this is fun and I'd love to help.


Return to Archive home page | Return to MIDRANGE.COM home page