0

I have a file abc.txt which contains text like that:

ABC01
ABC02
DEF09
EFG92

I want to append 'I' to end of every line in the file. I am opening the file in vim editor and using the following command:

:%s/\n/I\n/g

But I am not getting the desired result.

When I used:

%s/$/I/g

I got what I wanted .

I am curious to know why the first method failed.

melpomene
  • 79,257
  • 6
  • 70
  • 127
Bhawan
  • 2,051
  • 2
  • 17
  • 30

0 Answers0