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
  • 81,915
  • 7
  • 76
  • 137
Bhawan
  • 2,223
  • 2
  • 18
  • 38

0 Answers0