I have 4 big files which contains one big line containing formatted character records, I need to format each file in such way that each File will have 95 Characters per line. Last line of each file will have newline character at end.
Thanks vbe, scottaazz & Scrutinizer. All your solution worked.
Can you guys please tell me what I need to do in order to add new line after only last line in the file?
dd's unblock conversion yields variable length records/lines. If, as you say, the result must consist of 95 character lines, you cannot use that dd approach, because it will strip trailing space characters from a 95 character block and leave something shorter.
If fold is used, and if the input text may contain tabs (or backspace characters), if those bytes should not be treated specially (count as 1 byte instead of modifying fold's width counter), the -b option should be used.