I have a string and i want to do for loop to extract everything between "Open conversation" to "Open conversation" and then put it in list, dataframe or anything else. please look at the picture to get my question clearer.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
I have a question in python.

 

 I have a string and i want to do for loop to extract everything between "Open conversation" to "Open conversation" and then put it in list, dataframe or anything else. please look at the picture to get my question clearer.

sample of the data string that i have: 
 
Open conversation
#FAQ_Saturday_Branch @acc-inv:دوام الفروع متى يداومون 09/21/2022 @ 2:50 PM
 
Open conversation #FAQ_Branch_Working_Hours @duration:متى متى دوام الفروع عندكم 09/21/2022 @ 2:50 PM
 
Open conversation #FAQ_Branch_Working_Hours @duration:متى صالات المطار 09/21/2022 @ 2:50 PM
 
Open conversation #NVG_CS_Airport_Lounge No entities صالات المطار 09/21/2022 @ 2:50 PM
 
Open conversation #NVG_CS_Airport_Lounge No entities بطاقة المسافر تدخلني لصالات المطار ؟ 09/21/2022 @ 2:49 PM
 
Open conversation #FAQ_Cards_Traveler_AirportLounge @card:Traveler وش هي بطاقة المسافر 09/21/2022 @ 2:49 PM
 
Open conversation #FAQ_Traveler_Issuance_Eligibility @card:Traveler وش هي بطاقة المسافر 09/21/2022 @ 2:49 PM
 
 
Any ideas: 
+
X
↑
Open conversation
#FAQ_Branch_Working_Hours
ملی
متی: duration@
دوام الفروع عندكم
09/21/2022 @ 2:50 PM
Open conversation
#FAQ_Branch_Working_Hours
✓ ▶ Run ■ C ▶ ▶ Code
متی: duration@
صالات المصال
09/21/2022 @ 2:58 PM
Open conversation
#NVG_CS_Airport_Lounge
No entities
صالات المطر
09/21/2022 @ 2:59 PM
Open conversation
#NVG_CS_Airport_Lounge
No entities
بطاقة الساق
تدخلني لصالات المطار ؟
09/21/2022 G 2:49 PM
Open conversation
#FAQ_Cards_Traveler_Airport Lounge
@card: Traveler
بطاقة المسافر
69/21/2022 @ 2:49 PM
Open conversation
#FAQ_Traveler_Issuance_Eligibility
@card: Traveler
ول هي
بطاقة المسافر
09/21/2022 @ 2:49 PM
Open conversation
#FAQ_Cards_Traveler_Fees
@card: Traveler
ابی تفاصیل
بطاقة المسافر
کم
الرسوم
09/21/2022 @ 2:49 PM
Open conversation
#NVG_Traveler_card
@card: Traveler
لبطاقة المسافر
09/21/2022 @ 2:48 PM
بها
>
Transcribed Image Text:+ X ↑ Open conversation #FAQ_Branch_Working_Hours ملی متی: duration@ دوام الفروع عندكم 09/21/2022 @ 2:50 PM Open conversation #FAQ_Branch_Working_Hours ✓ ▶ Run ■ C ▶ ▶ Code متی: duration@ صالات المصال 09/21/2022 @ 2:58 PM Open conversation #NVG_CS_Airport_Lounge No entities صالات المطر 09/21/2022 @ 2:59 PM Open conversation #NVG_CS_Airport_Lounge No entities بطاقة الساق تدخلني لصالات المطار ؟ 09/21/2022 G 2:49 PM Open conversation #FAQ_Cards_Traveler_Airport Lounge @card: Traveler بطاقة المسافر 69/21/2022 @ 2:49 PM Open conversation #FAQ_Traveler_Issuance_Eligibility @card: Traveler ول هي بطاقة المسافر 09/21/2022 @ 2:49 PM Open conversation #FAQ_Cards_Traveler_Fees @card: Traveler ابی تفاصیل بطاقة المسافر کم الرسوم 09/21/2022 @ 2:49 PM Open conversation #NVG_Traveler_card @card: Traveler لبطاقة المسافر 09/21/2022 @ 2:48 PM بها >
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Thanks a lot for your answer, but the output is far from what i wanted, 

"Open conversation" is together 

To edit my Question above, i think its better if its start from conversation to Open and then conversation to Open and so on, 

i want to go through it all...

 

here more details for you---


conversation
#FAQ_Saturday_Branch @acc-inv:دوام الفروع متى يداومون 09/21/2022 @ 2:50 PM
 
Open

-----------------------------

then :

conversation #FAQ_Branch_Working_Hours @duration:متى متى دوام الفروع عندكم 09/21/2022 @ 2:50 PM
 
Open

--------------
then : 
 
conversation #FAQ_Branch_Working_Hours @duration:متى صالات المطار 09/21/2022 @ 2:50 PM
 
Open
 
~AND SO ON~
 
 
 
for j in range(i + 1, length + 1):
sub = word[i:j]
if sub.startswith(conversation) and sub.endswith(Open):
print (sub)
3]: sp = n.split("Open conversation
sp.remove(sp[8])
]: print (sp)
[*\n#FAQ_Saturday_Branch\n@acc-inv:>\nell \n\n\n09/21/2022 @ 2:50 PM\n', "\n#FAQ_Branch_Working He
\_\n\_\n Si Ewill ply\n09/21/2022 @ 2:50 PM\n', '\n#FAQ_Branch_Working Hours\n@duration:\n\n89/21
\n', '\n#NVG_CS_Airport_Lounge\nNo entities\n\n09/21/2022 @ 2:50 PM\n', '\n#NVG_CS_Airport_Lounge
F\n {J CYLd Sk\n09/21/2022 @ 2:49 PM\n', '\n#FAQ_Cards_Traveler_Airport Lounge\n@card: Traveler\n
9/21/2022 @ 2:49 PM\n', '\n#FAQ_Traveler_Issuance_Eligibility\n@card: Traveler\n\\n89/21/202
\n#FAQ_Cards_Traveler_Fees\n@card: Traveler\n\n\n09/21/2022 @ 2:49 PM\n', '\n#NVG_Traveler
ler\n- \n-\n \n09/21/2022 @ 2:48 PM\n', '\n#FAQ_Cards_Traveler_Fees\n@fees:General\n@fees:
J)
2822 @ 2:47 PM\n', '\n#NVG_Traveler_Card\n@card: Traveler\n\n \n89/21/2022 @ 2:47 PM\n', '\n#NVG_Cards
rd\n__ \n@_ _b\n {SD\n09/21/2022 @ 2:47 PM\n', '\n#NVG_Mada_Classic\n@service:Card Issuance\n@card: Ger
-\n89/21/2022 @ 2:46 PM\n', '\n#FAQ_Alinma_Post\nNo entities\n san09/21/2022 @ 2:45 PMV
Post\nNo entities\n
\n²b\n \n09/21/2022 @ 2:45 PM\n', '\nIrrelevant\n@service:Card Issuance\n@ca
→ \n\y$\n \n²-\n\n\n\n09/21/2022 @ 2:45 PM\n', '\n#FAQ_Card_Delivery_Fees\n@duration: 4
@fees:-\n1 more...\n \n \n\n\n\n09/21/2022 @ 2:44 PM\n', '\n#FAQ_Cards_Delivery Dur
Sy\n@service:Card Delivery\n\n\n\n\n\n09/21/2022 @ 2:44 PM\n', '\n#FAQ_Card_Delivery.
\n@fees:\n@service:Card Delivery\n]\n\+b\n \n09/21/2022 @ 2:44 PM\n', '\nIrrelevant\n@service
4 \n¹4b\n \n09/21/2022 @ 2:44 PM\n', '\n#FAQ_Cards_Close_Steps\n@service:Card Issuance\n\n
@2:43 PM\n',
Intent
'\n#CMP_Cards_Lost\n@closureReason:\n@cardchoice:4\n@cardchoice:2
طريق البريدn\ اطلب البطاقة
\n\n09/21/2022 @ 2:43 PM\n', '\n#FAQ_Request_Card_Delivery\n@service:Card Delivery\n
\n09/21/2022 @ 2:43 PM\n', '\n#NVG_SS_UpdatingData\n@data:\n\n\n\n89/21/2022 @ 2
IAN sens
IRIN WEE
MA
Ma
1
Transcribed Image Text:for j in range(i + 1, length + 1): sub = word[i:j] if sub.startswith(conversation) and sub.endswith(Open): print (sub) 3]: sp = n.split("Open conversation sp.remove(sp[8]) ]: print (sp) [*\n#FAQ_Saturday_Branch\n@acc-inv:>\nell \n\n\n09/21/2022 @ 2:50 PM\n', "\n#FAQ_Branch_Working He \_\n\_\n Si Ewill ply\n09/21/2022 @ 2:50 PM\n', '\n#FAQ_Branch_Working Hours\n@duration:\n\n89/21 \n', '\n#NVG_CS_Airport_Lounge\nNo entities\n\n09/21/2022 @ 2:50 PM\n', '\n#NVG_CS_Airport_Lounge F\n {J CYLd Sk\n09/21/2022 @ 2:49 PM\n', '\n#FAQ_Cards_Traveler_Airport Lounge\n@card: Traveler\n 9/21/2022 @ 2:49 PM\n', '\n#FAQ_Traveler_Issuance_Eligibility\n@card: Traveler\n\\n89/21/202 \n#FAQ_Cards_Traveler_Fees\n@card: Traveler\n\n\n09/21/2022 @ 2:49 PM\n', '\n#NVG_Traveler ler\n- \n-\n \n09/21/2022 @ 2:48 PM\n', '\n#FAQ_Cards_Traveler_Fees\n@fees:General\n@fees: J) 2822 @ 2:47 PM\n', '\n#NVG_Traveler_Card\n@card: Traveler\n\n \n89/21/2022 @ 2:47 PM\n', '\n#NVG_Cards rd\n__ \n@_ _b\n {SD\n09/21/2022 @ 2:47 PM\n', '\n#NVG_Mada_Classic\n@service:Card Issuance\n@card: Ger -\n89/21/2022 @ 2:46 PM\n', '\n#FAQ_Alinma_Post\nNo entities\n san09/21/2022 @ 2:45 PMV Post\nNo entities\n \n²b\n \n09/21/2022 @ 2:45 PM\n', '\nIrrelevant\n@service:Card Issuance\n@ca → \n\y$\n \n²-\n\n\n\n09/21/2022 @ 2:45 PM\n', '\n#FAQ_Card_Delivery_Fees\n@duration: 4 @fees:-\n1 more...\n \n \n\n\n\n09/21/2022 @ 2:44 PM\n', '\n#FAQ_Cards_Delivery Dur Sy\n@service:Card Delivery\n\n\n\n\n\n09/21/2022 @ 2:44 PM\n', '\n#FAQ_Card_Delivery. \n@fees:\n@service:Card Delivery\n]\n\+b\n \n09/21/2022 @ 2:44 PM\n', '\nIrrelevant\n@service 4 \n¹4b\n \n09/21/2022 @ 2:44 PM\n', '\n#FAQ_Cards_Close_Steps\n@service:Card Issuance\n\n @2:43 PM\n', Intent '\n#CMP_Cards_Lost\n@closureReason:\n@cardchoice:4\n@cardchoice:2 طريق البريدn\ اطلب البطاقة \n\n09/21/2022 @ 2:43 PM\n', '\n#FAQ_Request_Card_Delivery\n@service:Card Delivery\n \n09/21/2022 @ 2:43 PM\n', '\n#NVG_SS_UpdatingData\n@data:\n\n\n\n89/21/2022 @ 2 IAN sens IRIN WEE MA Ma 1
Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Lists
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education