Clean up text

Count characters, deduplicate and clean lines