hope you are doing well during this time. The thing is I d like to comment some lines in my txt file. I have a code to comment and uncomment multiple lines, however I dont know how to get company name. My text file has this scheme: lunar_static KKK_<countryname>_NUM 08.00.name
lunar_static KKK_USA_NUM 08.00.Winter
lunar_static KKK_ITALY_NUM 08.Winter
lunar_static KKK_ITALY_NUM 08.00.Spring
lunar_static KKK_ITALY_NUM 08.00.Autumn
lunar_static KKK_SPAIN_NUM 08.00.Winter
lunar_static KKK_SPAIN_NUM 08.00.Spring
lunar_static KKK_FRANCE_NUM 08.00.Autumn
lunar_static KKK_FRANCE_NUM 08.00.Autumn
lunar_static KKK_ITALY_NUM 08.00.Ferari-taxi
lunar_static KKK_ITALY_NUM "/^08\\.00\\.Delta\\ M$/"
lunar_static KKK_ROMANIA_NUM "/^08\\.00\\.Delta\\ M$/"
lunar_static KKK_ITALY_NUM "/^08\\.00\\.Red\\_Park$/"
and I wanna comment ITALY with name Autumn, Ferari-taxi, Delta M, Red_Park. I know how comment few names with sed like
sed -i '/Winter\|Spring/s/^/#/' file2.txt
and uncomment
sed -i '/Spring/s/^#//' file2.txt
but it chooses all names despite of country name. Dont know how to get country. EXPECTED OUTPUT
lunar_static KKK_USA_NUM 08.00.Winter
lunar_static KKK_ITALY_NUM 08.Winter
lunar_static KKK_ITALY_NUM 08.00.Spring
#lunar_static KKK_ITALY_NUM 08.00.Autumn
lunar_static KKK_SPAIN_NUM 08.00.Winter
lunar_static KKK_SPAIN_NUM 08.00.Spring
lunar_static KKK_FRANCE_NUM 08.00.Autumn
lunar_static KKK_FRANCE_NUM 08.00.Autumn
#lunar_static KKK_ITALY_NUM 08.00.Ferari-taxi
#lunar_static KKK_ITALY_NUM "/^08\\.00\\.Delta\\ M$/"
lunar_static KKK_ROMANIA_NUM "/^08\\.00\\.Delta\\ M$/"
#lunar_static KKK_ITALY_NUM "/^08\\.00\\.Red\\_Park$/"
I would be glad for every advice. Thank you!
sed.