I have a text file that contains a lot of data. I want to be able to read the text file and write a new text file. However on the new text file I don't want it to include some part of the orginal.
For example the text file has
------------------------
Age: 39
Gender: Female
Smoking: Yes
remarks: something about the person
-----------------------
Age: 52
Gender: Male
Smoking: Yes
remarks: something about the person
-----------------------
How do I get the new file to only read in age and gender so that the new text file will look like (also including the dashes that are divide each entry):
-----------------------
Age: 39
Gender: Female
-----------------------
Age: 52
Gender: Male
-----------------------
I've seen a couple of codes and other questions but they all are not just removing specific lines.