Artificial intelligent assistant

vi -- replace chars from part of line I've got a file with all Belgian cities. Some of these cities have boroughs. Lier;stad;Antwerpen;49,70;33930;Lier;Koningshooikt Knokke-Heist;gem.;WestVlaanderen;56,44;33825;Knokke;Westkapelle;Heist;Ramskapelle But I want to divide the boroughs with `, and space` instead of `;`. So I want to get this: Lier;stad;Antwerpen;49,70;33930;Lier, Koningshooikt Knokke-Heist;gem.;West-Vlaanderen;56,44;33825;Knokke, Westkapelle, Heist, Ramskapelle I use `vi` regularly but this kind of substitution is hard for me.

You could do (assuming GNU `sed`):


:%!sed 's/;/, /6g'


To replace the 6th to last `;` with `,`.

With `vim` using look-behind operators:


:%s/\v((;.*){5})@<=;/, /g


(that is replace the `;`s that are preceded by at least 5 `;`s).

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 8646c5c39d24077475fc2a5ba6a23f60