Basics of file:
Record starting with 'AD' is the parent record and all the sub records starting with other sequences are its properties (of parent 'AD' record).
"," is the delimiter for the file.
Here 1 hierarchy means: Record starting with 'AD' and all its sub-records i.e. till we encounter another 'AD' record
There may be as lowest as 1 property or as highest as 8 properties for each hierarchy ('AD' record).
There may be millions of such hierarchies...
Could you please help me to split the master file into several sub files using UNIX script such that each sub file contain 1000 hierarchies each (1000 'AD' records along with their properties records)
I have an idea on splitting the file based on first field, but not sure how to split it based on a hierarchy or pattern.