时尚 娱乐明星 设计 家装家居 过节指南圣诞节穿搭^M 圣诞月怎么红红绿绿怎么来
I am reading in a text file like above:
with open('test.tsv', 'r', encoding='utf8') as f:
for line in f:
print(f)
Due to the ^M character, the line ends at this character, not the whole line. How to read the whole text as one single line instead of multiple lines? I can replace it with a space.
In vim, I tried Ctr+M on my mac to search it, but the search failed. How to either remove it in vim or in python code to replace it with a space?