I am reading a text file with the following sentence:
"So whether you’re talking about a Walmart or an IKEA or a Zara, you are really interested in keeping the cost low, keeping the process very efficient."
my code:
files = "*.txt"
for pathname in glob.glob(files):
with open(pathname,'r') as singlefile:
data = "".join(singlefile.readlines())
data = re.sub(r"(?<=\w)\n", " ", data)
data = re.sub(r",\n", ", ", data)
print data
result I got is
"So whether you鈥檙e talking about a Walmart or an IKEA or a Zara, you are really interested in keeping the cost low, keeping the process very efficient. That gives us operational excellence."
Can anyone tell me what is wrong? Thanks!