I have a .txt file with below entries
filename.type1
filename.type1
filename.type2
filename.type3
filename.type3
filename.type4
filename.type5
For any and all entries of .type1 and .type2, it shall delete and then add respective entry in .txt file as filename_important.type1, or .type2.
Modified file shall look like:
filename_important.type1
filename_important.type1
filename_important.type2
filename.type3
filename.type3
filename.type4
filename.type5