Wow, I'm thankful for all of the responses on this! To clarify the data pattern does repeat. Here is a sample:
Item: some text Name: some other text Time recorded: hh:mm Time left: hh:mm other unrelated text some other unrelated text lots more text that is unrelated Item: some text Name: some other text Time recorded: hh:mm Time left: hh:mm other unrelated text some other unrelated text lots more text that is unrelated Item: some text Name: some other text Time recorded: hh:mm Time left: hh:mm and so on and so on
I am using Python 3.7 to parse input from a text file that is formatted like this sample:
Item: some text Name: some other text Time recorded: hh:mm Time left: hh:mmand the pattern repeats, with other similar fields, through a few hundred pages.
Because there is a ":" value in some of the values (i.e. hh:mm), I not sure how to use that as a delimiter between the key and the value. I need to obtain all of the values associated with "Item", "Name", and "Time left" and output all of the matching values to a CSV file (I have the output part working)
Any suggestions? Thank you!
(apologies, I asked this on Stack Exchange and it was deleted, I'm new at this)
': '(with the space) as delimitersome text, too.