I am working with a huge data set of about 10,500 lines that need to be split up into separate parts that include title, date, rating, and length. Here is how the data is formatted: Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars, 1hr 21m
I have already figured out how to split the data in half using .split, but I am not sure as to how to split up the first and last half of the title into the title and date when the title has parenthesis in it also, such as: Dhobi Ghat (Mumbai Diaries) (2010) | 3.6 stars, 1hr 42m.
There are also instances in which some of these fields can be empty, so no rating, date or length, and those are also causing me some issues. Can anyone point me in the right direction? Any help would be appreciated!
EDIT: So I forgot to mention (sorry), I need any dates, and ratings as integers because later I will need to be able to apply filters, such as search all entries with rating > 3.5, or movies after 1998, things like that. That throws another wrench in this that I am still working with. Thank you for all the help so far!