remove excess spaces in extracted text