How To Add Full Email Body Text from File to CLOB Column? [message #679818] |
Wed, 01 April 2020 15:53 |
|
bmccollum
Messages: 15 Registered: April 2020
|
Junior Member |
|
|
I have a Python script which does the following:
- Cycles through incoming messages in an email inbox every few min.
- Saves the content of the body of each email msg. as individual .txt files for each email msg.
- Accesses each .txt file afterwards for purposes of parsing through the contents of ea. file in identifying pertinent data contained within ea. .txt file
- Saves the pertinent info. from ea. .txt file to an Oracle database table
The problem I'm having is with an "EmailBody" column in Oracle (it's a CLOB column). We erase each email once it's determined that the emails have been successfully saved to .txt files that will be soon processed by the Python script. With that in mind, should something with the insertion of data from the .txt files into Oracle not go entirely correct, we want to have the full email body saved to the "EmailBody" column so we can revisit the full email in this manner from the CLOB column and reprocess if if needed.
The .txt files that I'm creating from the emails are all very readable and have line breaks or carriage returns in all appropriate spots.
Once I insert the full email body text into the "EmailBody" column in Oracle and I go back to the "EmailBody" column to look at the text that's been inserted into that column, all of the data is basically jumbled together with the line feeds and/or carriage returns stripped.
Does anyone have experiencing having done this in the past or had this same challenge with the stripped line feed / carriage returns and come up with a solution as to how to insert contents from a .txt file accurately with all pre-existing line feed / carriage return characters in place in the Oracle CLOB column just like they were present in the original .txt file?
Thanks in advance for any info. anyone can provide.
|
|
|
|