There seem to be two main types of logic involved in this :

Parsing:
1. Parse a string (IOW, the contents of a file) and create an grouped
List of strings based on :
a) Read a char, store it and keep reading the next char till the
character does not match the first char. Keeping track of the start
location, store the string read till now in the List. Set this
location as the start location for the next iteration.
b) Repeat a) till EOF.
c) Store one such List<string> for each file you parse.

Output: (this part becomes very straightforward)
2. Create a third List<string> by interpolating items from each
candidate List. Output it to a file (using something like: string.join
(List.ToArray()))

It should now be a 5 min. job to write the code from this.

Reply via email to