It looks like you'll be parsing strings (e.g. detecting the "02" pattern), so if you haven't already started down the (great, life-changing, amazingly-useful) path of learning how to use regular expressions, that's going to be your best first step.
Once you have some practice regex-ing, you'll find that nearly every (practical) programming language under the sun (including R/Python/Julia and even some spreadsheets) has a regex implementation or library that follows roughly the same syntax. Regex standardization is truly one of the most (if not the most) stable de-facto standards in all of programming
!
(And once you have some regex patterns in mind for your data, you can simply read in the file lines then use those patterns to split up your data appropriately.)