I have a text file like this:
X0122 Yellow Car $1200 YK321 Black Car $400 BZ321132 Red Boat $2344
every line is separated by a
I want to join every 3 elements in a line separated by
;. So, the file will be converted into this:
X0122;Yellow Car;$1200 YK321;Black Car;$400 BZ321132;Red Boat;$2344
How do I do that on unix?
Note: the files may contain accented letters like á, ó, ã and single quotes and are coded in "UTF-8 Unicode English text, with very long lines", like the command
file say about them.