I have data that looks like this:
"1964 iwanttoholdyourhand beatles
^M
oh yeah, i'll tell you something
i think you'll understand
when i'll say that something
i wanna hold your hand
i wanna hold your hand
i wanna hold your hand
oh please, say to me
you'll let me be your man
and please, say to me
you'll let me hold your hand
i'll let me hold your hand
i wanna hold your hand"
and I'm trying to get rid of the ^M, so I tried using a re.sub but that doesn't find it - I think is some special character and not actually a "^" and "M" next to each other. any ideas on how to remove it? Thanks!
^M is used to represent the carriage return character in many editors. You would typically type Ctrl + M to generate that character in those editors.
Python represents this as '\r', as do most programming languages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With