
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
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:

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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 1 images

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](https://content.bartleby.com/qna-images/question/83c28e2d-a015-431c-a272-6452453c4958/e859de28-39a9-48c5-9865-88a742215637/11gh95m_thumbnail.jpeg)
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
by Bartleby Expert
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](https://content.bartleby.com/qna-images/question/83c28e2d-a015-431c-a272-6452453c4958/e859de28-39a9-48c5-9865-88a742215637/11gh95m_thumbnail.jpeg)
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
by Bartleby Expert
Knowledge Booster
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
- I have a dictionary that comprises of numerous volumes, each of which is a book, on my bookcase of paper books. A-E is covered by one, F-J by another, K-M by another, and so on. I look at the alphabetic ranges to get the proper loudness to discover a word. Then I turn to the appropriate page by using the ranges at the top of each page. After that, I look for the word on the page.arrow_forwardPlease write a full C++ and name the multiple files. Also, include the actual code and not a screenshot please. Please provide the code itself and not just the outputarrow_forwardExplain why mobile devices are so integral to the present trend of digital device convergence.arrow_forward
- Written in python with docstrings if applicable. Thanksarrow_forwardWrite a python program that creates a dictionary containing the U.S. states as keys, and their capitals as values. The program should then randomly quiz the user by displaying the name of a state and asking the user to enter that state's capital. The program should keep a count of the number of correct and incorrect responses. This program has really been giving me trouble. Any help is greatly appreciated. Thanks so much!arrow_forwardYou are going to write a program (In Python) called BankApp to simulate a banking application.The information needed for this project are stored in a text file. Those are:usernames, passwords, and balances.Your program should read username, passwords, and balances for each customer, andstore them into three lists.userName (string), passWord(string), balances(float)The txt file with information is provided as UserInformtion.txtExample: This will demonstrate if file only contains information of 3 customers. Youcould add more users into the file.userName passWord Balance========================Mike sorat1237# 350Jane para432@4 400Steve asora8731% 500 When a user runs your program, it should ask for the username and passwordfirst. Check if the user matches a customer in the bank with the informationprovided. Remember username and password should be case sensitive.After asking for the user name, and password display a menu with the…arrow_forward
- In python: student_dict is a dictionary with students' name and pedometer reading pairs. A new student is read from input and added into student_dict. For each student in student_dict, output the student's name, followed by "'s pedometer reading: ", and the student's pedometer reading. Then, assign average_value with the average of all the pedometer readings in student_dict..arrow_forwardWrite a python program that stores current grades in a dictionary, with course codes as keys and percent grades as values. Start with an empty dictionary and then use a while loop to enable input of course codes and percent grades from the keyboard. Enter data for at least five courses. After entering the data, use a for loop and the keys to show the current status of all courses. This same loop should include code that enables determination of the worst course and the average of all courses. Both of these findings should be printed when the loop ends. The worst course should be dropped and reported. This being done, the program should use another loop and the items method to display the revised courses and grades and report the revised term average.arrow_forwardWrite a Python program that creates a dataframe from a dictionary of lists and displays the first 5 rows. The dictionary should have keys "name", "age" and "gender" and values as lists of names, ages and genders respectively. Use the pd.DataFrame() function to create the dataframe and the df.head() method to display the first 5 rows.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education