nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] m_getfld() bug fix

2013-12-08 04:47:27
Hi again David,

I wonder if `diff -b' is the wrong approach as it's applying the -b to
the whole file.  Would using sed to canonicalise that one line to no
spaces at start or end, and only one space in between be better?

Something like

    sed '/<div>/n; /Need/!n; s/   */ /g; s/^ //; s/ $//'

If the line contains "<div>", start again with the next one.
If the line doesn't contain "Need", start again with the next one.
# We're now on the non-<div> Need line.
Replace runs of two or more spaces with a single space.
Remove any leading single space.
Ditto trailing.

-- 
Cheers, Ralph.
http://uk.linkedin.com/in/ralphcorderoy/

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>