There are 3 million records in the sample file below and it is 3 gb in size (i.e. - unable to be opened in a standard text editor).
HDR FILE VERSION 1.0
D|35|07/11/1997|John|Smith|D||||06/10/1964|39:4-85|Improper Passing|||||1906||Franklin|||
D|35|07/11/1997|Emma|Franks|G||||07/5/1951|39:3d-9|Speeding|||||1906||Bergen|||
D|35|07/11/1997|Ed|Jobs|||||10/2/1982|39:4-56c|StopSign|||||1906||Ocean|||
……….
……….
TRL 3,000,000 RECORDS

Can you Programmatically demonstrate to me how to complete the following tasks?:
1. Create 2 separate files from this single file, whereby one new file has all the records containing the word Franklin and the second file has everything else
2. Validate that the total number of lines in the original file is equal to the total number of lines contained in both new files created in step #1 above.
3. Add one additional pipe (“|”) to the end of each line in the file