For Illustrator write a Script with Regular Expressions in JavaScript that searches Line Breakes \r and puts nothing instead. To edit that script this Link might help. Perform grep search The first sections are relevant.
First you need to use Find and Replace command from Command Palette on your Mac to search for text that should be replaced.