Creation of .CRM file and delimiter insertion (HEXA 0D0A) after certain block of information

0

I am creating a text file in PHP that saved with the .CRM extension, used for bank collection files. The file, in its structure, has 3 parts: HEADER, DETAIL and TRAILER. Each has 400 exact characters in the file. At the end of each of these parts, I need, according to the documentation, to insert:

"At the end of the file, that is, after the Header, Detail and Trailer information there should be the Tape Mark or file finalizer which is also known in the encoding as a delimiter (HEXA 0D0A) .It is as if after the last column 400 of the Trailer was given an ENTER to go to the next line. "

Someone who can help me insert this delimiter? If I open the file and count the characters, I have a total of 1202 (400 of the header, 400 of the detail, 400 of the trailer and 2 are of line-break between header-detail and detail-trailer). This precise line break eliminates (replace by the delimiter) so that the file has the 1200 characters.

    
asked by anonymous 15.06.2018 / 21:32

0 answers