Python Forum
split strip issues 'NonType'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
split strip issues 'NonType'
#5
(Oct-07-2019, 05:44 PM)ichabod801 Wrote: So if 'Classification' is in the email, you want to split by that, otherwise split by 'Sent by BlackBerry Work'? In that case it's just:

if "Classification:" in filtered_artifacts_item_1_0:
    splitresponse__response_value = filtered_artifacts_item_1_0[0].split('Classification:')  
else:
    splitresponse__response_value = filtered_artifacts_item_1_0[0].split("Sent with BlackBerry Work")

Thank you, it accepted the syntax, still getting a NonType error but I'm going to have a fresh message sent to confirm it's just not ingesting a blank form.

Do you see any issues with my adding a third split? Also, I added [0].strip() to the end of each splitresponse as I want it to strip out the remainder of the email body. Correct?

   if "Classification:" in filtered_artifacts_item_1_0: 
        splitresponse__response_value = filtered_artifacts_item_1_0[0].split('Classification:')[0].strip() 
    else: splitresponse__response_value = filtered_artifacts_item_1_0[0].split('Sent with BlackBerry Work')[0].strip()
    splitresponse__event_id = filtered_artifacts_item_1_0[0].split('*****************')[1].strip()
Reply


Messages In This Thread
split strip issues 'NonType' - by casacafe - Oct-07-2019, 04:47 PM
RE: split strip issues 'NonType' - by ichabod801 - Oct-07-2019, 04:56 PM
RE: split strip issues 'NonType' - by casacafe - Oct-07-2019, 05:16 PM
RE: split strip issues 'NonType' - by ichabod801 - Oct-07-2019, 05:44 PM
RE: split strip issues 'NonType' - by casacafe - Oct-07-2019, 08:45 PM
RE: split strip issues 'NonType' - by ichabod801 - Oct-07-2019, 08:47 PM
RE: split strip issues 'NonType' - by casacafe - Oct-07-2019, 08:52 PM
RE: split strip issues 'NonType' - by casacafe - Oct-08-2019, 06:23 PM
RE: split strip issues 'NonType' - by ichabod801 - Oct-08-2019, 06:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  extract only text strip byte array Pir8Radio 7 2,921 Nov-29-2022, 10:24 PM
Last Post: Pir8Radio
Smile please help me remove error for string.strip() jamie_01 3 1,194 Oct-14-2022, 07:48 AM
Last Post: Pedroski55
  Can't strip extra characters from Data Canflyguy 7 1,859 Jan-10-2022, 02:16 PM
Last Post: Canflyguy
  strip() pprod 8 3,449 Feb-16-2021, 01:11 PM
Last Post: buran
  Need help with code for my WS2812B (Neopixel) Led Strip Phibbl 1 2,756 Apr-08-2020, 07:18 PM
Last Post: deanhystad
  removing spaces/tabs after used .strip() zarize 0 1,578 Sep-11-2019, 12:46 PM
Last Post: zarize
  strip off just newlines Skaperen 11 5,319 Jun-19-2019, 06:28 PM
Last Post: Skaperen
  strip space from end of a row of text ineuw 4 2,874 Apr-15-2019, 03:14 AM
Last Post: ineuw
  How to remove whitespace from a string when .replace and .strip do not work winnetrie 7 4,447 Jan-05-2019, 08:44 AM
Last Post: DeaD_EyE
  Strip does not work when applied on a string read from a text file. susmis666 1 2,384 Dec-27-2018, 07:07 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020