Skip to content
Advertisement

Iterate through release notes and count fixes per date

I hope you are well. I’m trying to find every instance of “Fix” in release notes, and grab the date (which is usually a line above).

For example (section of release notes):

JavaScript

I would want to grab the amount of “fix” occurrences and their corresponding date.

Example output:

JavaScript

Here is what I’ve been trying:

JavaScript

Any help would be greatly appreciated. Thanks in advance.

Advertisement

Answer

Assuming your file looks like this:

JavaScript

Then you can use re module to parse it:

JavaScript

Prints:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement