Splitting when a line begins with a specific character

My colleague has to regularly split a large log file (in notepad - approx 12MB) into smaller files.

See below for a compact example of the document structure

A0201408246003448
A18330830000IM76058111370840597299 20140826+000000000041265406011179
B18308381113756615 +000000000020000+00001+000000000020294
B18308381113756694 +000000000040000+00001+000000000024056
A1830844000CC11648111370840597222 20140826-0000000000016320840597222
B18308441113756615 +000000000040000+00001+000000000040588
B18308441113756547 +000000000010000+00016+000000000002138
Z00000119598

The large file is split wherever a new line begins with “A”.
The same header and footer is then inserted to each small file.

So, our first ‘split’ file from the example above would look like this.

A0201408246003448
A18330830000IM76058111370840597299 20140826+000000000041265406011179
B18308381113756615 +000000000020000+00001+000000000020294
B18308381113756694 +000000000040000+00001+000000000024056
Z00000119598

I feel that the ‘split after the nth occurrence of a specified pattern’ tool should allow us to do this but I do not understand how it works.

If someone is able to tell me how to do this (using a version of the “0x0D0x0A” pattern I presume) that would be greatly appreciated!

I understand how to add a header and will figure out how to handle the footer.

Thanks!

The pattern 0x0D0x0A means two characters named CR LF

See:

So if you want to split after a new line and the A character that begins next line, you should use this pattern:

0x0D0x0AA