Hi all,
I want to split a large file (10,000) lines into 2 5,000 line files, but with a twist:
1. Records have a string that I sort the main input file on (not a fixed string, it changes).
2. when splitting the file, records with the same exact identifier must stay together.
So for example in the input file I have this:
Record1
(Line 4999) 11110 Someone
(Line 5000) 11111 BLAH BLAH
(Line 5001) 11111 BLAH JR.
(Line 5002) 11111 BLAH Three
(Line 5003) 11112 Someone Else
So the file can't be split in between BLAH BLAH and BLAH Jr. but instead split after BLAH Three.
Does that make sense? Any help would be greatly appreciated.
I want to split a large file (10,000) lines into 2 5,000 line files, but with a twist:
1. Records have a string that I sort the main input file on (not a fixed string, it changes).
2. when splitting the file, records with the same exact identifier must stay together.
So for example in the input file I have this:
Record1
(Line 4999) 11110 Someone
(Line 5000) 11111 BLAH BLAH
(Line 5001) 11111 BLAH JR.
(Line 5002) 11111 BLAH Three
(Line 5003) 11112 Someone Else
So the file can't be split in between BLAH BLAH and BLAH Jr. but instead split after BLAH Three.
Does that make sense? Any help would be greatly appreciated.