Re: Reading \n unescaped from a file

2015-09-06 Thread Friedrich Rentsch
On 09/06/2015 09:51 AM, Peter Otten wrote: Friedrich Rentsch wrote: My response was meant for the list, but went to Peter by mistake. So I repeat it with some delay: On 09/03/2015 04:24 PM, Peter Otten wrote: Friedrich Rentsch wrote: On 09/03/2015 11:24 AM, Peter Otten wrote: Friedrich R

Re: Reading \n unescaped from a file

2015-09-06 Thread Peter Otten
Friedrich Rentsch wrote: > My response was meant for the list, but went to Peter by mistake. So I > repeat it with some delay: > > On 09/03/2015 04:24 PM, Peter Otten wrote: >> Friedrich Rentsch wrote: >> >>> On 09/03/2015 11:24 AM, Peter Otten wrote: Friedrich Rentsch wrote: >>> I appreciat

Re: Reading \n unescaped from a file

2015-09-04 Thread Friedrich Rentsch
My response was meant for the list, but went to Peter by mistake. So I repeat it with some delay: On 09/03/2015 04:24 PM, Peter Otten wrote: Friedrich Rentsch wrote: On 09/03/2015 11:24 AM, Peter Otten wrote: Friedrich Rentsch wrote: I appreciate your identifying two mistakes. I am curious

Re: Reading \n unescaped from a file

2015-09-03 Thread Friedrich Rentsch
On 09/03/2015 06:12 PM, Rob Hills wrote: Hi Friedrich, On 03/09/15 16:40, Friedrich Rentsch wrote: On 09/02/2015 04:03 AM, Rob Hills wrote: Hi, I am developing code (Python 3.4) that transforms text data from one format to another. As part of the process, I had a set of hard-coded str.repl

Re: Reading \n unescaped from a file

2015-09-03 Thread Rob Hills
Hi, On 03/09/15 06:31, MRAB wrote: > On 2015-09-02 03:03, Rob Hills wrote: >> I am developing code (Python 3.4) that transforms text data from one >> format to another. >> >> As part of the process, I had a set of hard-coded str.replace(...) >> functions that I used to clean up the incoming text i

Re: Reading \n unescaped from a file

2015-09-03 Thread Rob Hills
Hi Chris, On 03/09/15 06:10, Chris Angelico wrote: > On Wed, Sep 2, 2015 at 12:03 PM, Rob Hills > wrote: >> My mapping file contents look like this: >> >> \r = \\n >> “ = " > Oh, lovely. Code page 1252 when you're expecting UTF-8. Sadly, you're > likely to have to cope with a whole pile of oth

Re: Reading \n unescaped from a file

2015-09-03 Thread Rob Hills
Hi Friedrich, On 03/09/15 16:40, Friedrich Rentsch wrote: > > On 09/02/2015 04:03 AM, Rob Hills wrote: >> Hi, >> >> I am developing code (Python 3.4) that transforms text data from one >> format to another. >> >> As part of the process, I had a set of hard-coded str.replace(...) >> functions that

Re: Reading \n unescaped from a file

2015-09-03 Thread Peter Otten
Friedrich Rentsch wrote: > On 09/03/2015 11:24 AM, Peter Otten wrote: >> Friedrich Rentsch wrote: > I appreciate your identifying two mistakes. I am curious to know what > they are. Sorry for not being explicit. >>> substitutes = [self.table [item] for item in hits if item >>> in

Re: Reading \n unescaped from a file

2015-09-03 Thread Friedrich Rentsch
On 09/03/2015 11:24 AM, Peter Otten wrote: Friedrich Rentsch wrote: On 09/02/2015 04:03 AM, Rob Hills wrote: Hi, I am developing code (Python 3.4) that transforms text data from one format to another. As part of the process, I had a set of hard-coded str.replace(...) functions that I used

Re: Reading \n unescaped from a file

2015-09-03 Thread Peter Otten
Friedrich Rentsch wrote: > > > On 09/02/2015 04:03 AM, Rob Hills wrote: >> Hi, >> >> I am developing code (Python 3.4) that transforms text data from one >> format to another. >> >> As part of the process, I had a set of hard-coded str.replace(...) >> functions that I used to clean up the incomi

Re: Reading \n unescaped from a file

2015-09-03 Thread Friedrich Rentsch
On 09/02/2015 04:03 AM, Rob Hills wrote: Hi, I am developing code (Python 3.4) that transforms text data from one format to another. As part of the process, I had a set of hard-coded str.replace(...) functions that I used to clean up the incoming text into the desired output format, something

Re: Reading \n unescaped from a file

2015-09-02 Thread Peter Otten
MRAB wrote: > On 2015-09-02 03:03, Rob Hills wrote: >> Hi, >> >> I am developing code (Python 3.4) that transforms text data from one >> format to another. >> >> As part of the process, I had a set of hard-coded str.replace(...) >> functions that I used to clean up the incoming text into the desir

Re: Reading \n unescaped from a file

2015-09-02 Thread MRAB
On 2015-09-02 03:03, Rob Hills wrote: Hi, I am developing code (Python 3.4) that transforms text data from one format to another. As part of the process, I had a set of hard-coded str.replace(...) functions that I used to clean up the incoming text into the desired output format, something like

Re: Reading \n unescaped from a file

2015-09-02 Thread Chris Angelico
On Wed, Sep 2, 2015 at 12:03 PM, Rob Hills wrote: > My mapping file contents look like this: > > \r = \\n > “ = " Oh, lovely. Code page 1252 when you're expecting UTF-8. Sadly, you're likely to have to cope with a whole pile of other mojibake if that happens :( You have my sympathy. > < = < >

Reading \n unescaped from a file

2015-09-02 Thread Rob Hills
Hi, I am developing code (Python 3.4) that transforms text data from one format to another. As part of the process, I had a set of hard-coded str.replace(...) functions that I used to clean up the incoming text into the desired output format, something like this: dataIn = dataIn.replace('\r'