Thank you all for the reply. I was basically flooded with optins and was bit confused which one to use. However, I have used the option given by Scrutinizer as I could comprehend it clearly. However, took note of all the commands which I can definitely use in future.
I did not understand your question completely. Which one are you referring to? The file might have lines containinig only NA or na. I do not need to add anything at the end of these lines. Because, there will be no files with the naem NA.txt or na.txt
Hence I need to exclude those lines. Was your question for this?
He had said "I wish to add the text ".txt" at the end of all lines except the lines starting with NA or na." while referring to his example. Although there are no examples of "nagging" or "NATIONAL" etc, instinctively, one would want to avoid matching words that start with NA or na and is part of a bigger word. Of course, if OP has not problem with that, then that's fine.