MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » September 2009

RE: Scanning a STMF for a string



fixed

I tried moving the sample file over to our v5 box, and trying your
"sed"
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.

Dennis







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

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact