I am trying to figure out a way to split a large file I have into smaller files. The main file can be 7+ meg in size I need to break into roughly 1 or 2 meg files. The problem I am having is the file needs to be broken up at specific point (from the start of an xml tag to the end of one). for example in the file I have start looks like this <CALL>9148933855122|110|||1| and end element </CALL><CALL>9148933854616|110|||1| Notice that the end is on the same line as the start of the next.
Each start to end element is about 100k so 10 would be a meg. I would like to process the file and create files with 10-20 calls per file. And name each file CALLnn.inserterror where nn is the file number. Does anybody know how to do this?

