For a file looking like this:
2 AD,42.546245,1.601554,Andorra,376
3 AE,23.424076,53.847818,United Arab Emirates,971
4 AF,33.93911,67.709953,Afghanistan,93
5 AG,17.060816,-61.796428,Antigua and Barbuda,1
I am trying to remove the leading spaces and numbers for the first 10 lines, so I'd end up with
AD,42.546245,1.601554,Andorra,376
AE,23.424076,53.847818,United Arab Emirates,971
AF,33.93911,67.709953,Afghanistan,93
AG,17.060816,-61.796428,Antigua and Barbuda,1
Why does "remove two words" :d2w
work for a single line, but not for a range :1,10d2w
?
NOTE:
The problem itself is solved due to the fixed format, using :1,10s/.\{8\}//
, so this is more about understanding how to use ranges with :dNw
:1,10s/\v^(\s|\d)*/
(remove any number of spaces or digits at the start of the first 10 lines)