Question
Consider the following CSV file 4 rows shown: quote|source|dob-dod|category There is no remedy but to love more.|Henry David Thoreau|1817-1862|romantic Work is the curse of the
Consider the following CSV file 4 rows shown:
quote|source|dob-dod|category
There is no remedy but to love more.|Henry David Thoreau|1817-1862|romantic
Work is the curse of the drinking classes.|Oscar Wilde|1854-1900|humourous
The paradise of the rich is made out of the hell of the poor.|Victor Hugo|1802-1885|political
Religion is what keeps the poor from murdering the rich.|Napoleon Bonaparte|1769-1821|political
a) Not using any external modules, write a PYTHON script to transform the above data to a valid XML structure using the header fields as element names. You should also generate a row-id as an attribute for each row in the file,
b) Only using the pymysql & csv modules, write a PYTHON script to create the three required tables and insert the CSV data above to a MySQL database.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started