in reply to Re^3: getting line count in cmd.exe
in thread getting line count in cmd.exe

My error was in failing to unwrap lines.

Meh; duh!

Thanks for putting me on the right track.