Taking a second look...you should be checking for the headers separately and then retrieving the channel data. The for loop needs to be around the channel data. You will need a different way of checking for headers. You see see how the original sketch you started with uses an empty for. That would be around the headers and data so the continue from not finding headers would go the empty for loop.

You are headed down the right track. Just needs refinement.