Hi ,
I have a doubt here
If my pattern is not fixed , like in below case then how can I do that using sed command .
I tried using awk command but it replaced N with Y in entire file.txt
Now that you have clarified your help request, it is clear that it has nothing whatsoever to do with this thread.
Resurrecting a dormant thread with an unrelated question is poor etiquette, a distraction, and a waste of time.
Most people will assume that a thread with a new post is an active conversation. They will read it top-down, most likely not immediately noticing the ages of the posts. And then, when they finally arrive at your new post, it has nothing to do with everything they've read up to that point.