-Every line is separated into 8 parts by colons
Input
-Every part can include words,numbers,space etc.
- Every line is separated into 8 parts by semicolons
- Every part can include words,numbers,space etc.
Output
I am trying to replace the space in the 6th part with a colonsemicolon, thus separating the line again, making the total number of parts 9.
Example
1;30;68;Az LEMda;Ads Awdsâ;1 Bethesda, Galilea, Impe Mkals;29;63 264;16 October 1978;2 April 2005;AAz Jgfg adal II;Madwl Qózca Asdtyła;20 May 1920 Maklo, Polasn;58;84 would beend up like this
1;30;68;Az LEMda;Ads Awdsâ;1;Bethesda, Galilea, Impe Mkals;29;63 264;16 October 1978;2 April 2005;AAz Jgfg adal II;Madwl Qózca Asdtyła;20;May 1920 Maklo, Polasn;58;84 Attempts
I tried to find the space using anything ranging from regex to \zs\zs but failed. ClosestThe closest I came was finding the 5th colonsemicolon.
%s/\(.\{-};\zs\)\{5}/;/g But iI need to find the space that comes after the number that comes after the 5th colonsemicolon, so this kind of thinking got me nowhere and now I am trying to find the space in the the parts that iI defined earlier.
I could put awkawk into vim but then again I am fairly new with it. I managed to find the 6th part and change the space into a colonsemicolon, but then it changes all the spaces, not just the first one.
:%! awk 'BEGIN{FS=OFS=";"} {gsub(/ /, ";", $6)} 1' How can I just change the first space in the 6th part?