define effective...because it would be possibly more effective if you specified which program the input file came from. matlab? lisp? other? if it's from any well known program, most likely already had a parser written for it, in perl or other that you could adapt.
the hardest line to type correctly is: stty erase ^H