I am a beginner and trying to extract content of some sections (like medical history) of text files assuming section header is all in upper case and content starts after colon ":". Extraction continues until it reaches a new line beginning at the very first position of the line with an upper case letter. The script works but I thought I could get your advise to make it more stable/efficient or maybe revise my approach to the problem. The only consistent pattern in my text files is that headers or section titles are all in upper case, start at the beginning of the sentence, and end in colon. Thank you for your feedback