I want to split string between a tab. Let's say I have some text in a file.txt
Kern_County_Museum 1,000,000+
Fairplex_railway_exhibit Depot and rolling stock
So I want to remove redundancy from left side and keep right side as it is.
import re
import string
import urllib
for line in open('file.txt', 'r').readlines():
left, right = string.split(line, maxsplit=1)
relation = string.split(line, maxsplit=1)
le = relation[0]
ri = relation[1]
le = urllib.unquote(relation[0])
le = le.replace('_', ' ')
print le, '\t', ri