I have a text file like this:X0122Yellow Car$1200YK321Black Car$400BZ321132Red Boat$2344every line is separated by a \nI want to join every 3 elements in a line separated by ;. So, the file will be converted into this:X0122;Yellow Car;$1200YK321;Black Car;$400BZ321132;Red Boat;$2344How 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.
joining a text file in groups of 3 entries
text processing
You can use paste:$ paste -sd';;\n' fileX0122;Yellow Car;$1200YK321;Black Car;$400BZ321132;Red Boat;$2344