The program has to be coded in C or awk. There is a large file containing about 2 to 3 million lines of plain text. This text has to be separated into various records and various sections within each record. Each section is identified by a certain sequence of characters in the file that appear at the start of a section. Within each section the text needs to be separated into multiple fields.
There are some sections that appear in every record and there are some sections that are optional. For example, file A contains 5 records called R. Two of those Rs have sections A,B, C and D. Two of them have sections A,B and D. One R has A, B and C.
Input: ASCII (text) file with numerous lines of text
Output: a) Various files - one per section (one file for A records, one for B and so on..
? ? ? ? ? ? ? ? ? ? ? ? ? b)? ? Fields within each file separated by a specific character
? ? ? ? ? ? ? ? ? ? ? ? c) Statistics on how many sections each R had. For example: Total:X Records, 2 Rs had all four, 2 had no C, two had no D.