Can i take these 3 bunches of code below

Actually, printf formatting has stymied legions of programmers. That is why, when C evolved into C++, string handling mostly transitioned to the String class which is much easier to use. But it has problems with memory on tiny processor architectures like the AVR used in the original Arduinos.