Hello,
I have a txt file which contains data in this format:
cross-sectional study 21225114.txt
prospective cross-sectional study 21225178.txt
cross-sectional study 21225178.txt
retrospective cohort 21225558.txt
retrospective cohort study 21225558.txt
cohort study 21225558.txt
This shows what type of study each of the txt files have. Problem is some have more that one study type which happens to be a sub type i.e,
prospective cross-sectional study 21225178.txt
cross-sectional study 21225178.txt
Thus, i want to have only one type of study for one txt file which has to be the more specific like this:
prospective cross-sectional study 21225178.txt
retrospective cohort study 21225558.txt
Any thoughts on how can i do that? I am completely stuck :( :( I would have done it with line.split()[something] but the columns keep changing due to more specific studies.