Improve robustness of text importer

The aim is to avoid errors when there's an empty line.
This happen often at the end of the file.
Here's what the change does:
- Trimmed the line string before splitting it
- Skip line if empty