I want to append a character multiple times for specific lines in a file so all of them would have x characters
Let's say I want all the lines between 20 and 80 to have the same number of characters(50) and the same character appended at the end:
for y in range(20, 80) | if strlen(getline(y)) !=50 | for i in range(50-strlen(getline(y))) | execute y .. 's/$/./' | endfor | endif | endfor
returns
E727:Start past end and E1098: String, List or Blob required
if I use it with a specific line it works just fine
if strlen(getline(N)) !=50 | for i in range(50-strlen(getline(N))) | execute N .. 's/$/./' | endfor | endif
Eg:
Input:
abcdef
defghijklm
foo
Output:
abcdef**********
defghijklm******
foo*************