A diary is a personal journal, so technically there's no real "format" involved. Sometimes people will begin an entry, "Dear Diary," as if they are writing a letter to the book itself. The most important item in a diary entry is the date that it was written.
Telegrams were formatted by the cable company that forwarded the message. Western Union was one of the largest companies, but there were others and each had its own method of formatting the message. (My very first job, in fact, was as a Telex operator, so I have some first-hand knowledge of the system.)
For many years, it worked like this: the sender would hand-write or dictate his message, and a teletype operator would type it up. The message printed out in all capital letters on thin strips of adhesive-type tape. The strips would then be glued down onto a telegram blank and sent on its way. Some telegraph companies didn't allow punctuation in the messages, so they were spelled out instead (QUESTION MARK or STOP, etc) Since most companies charged by the word, though, many people completely omitted any punctuation and let the recipient figure it out for himself. Here is a photo of World War II-era telegram.