Updated streaming script with a preprocessing step to remove new lines