If you now the relative coordinates for every line you can setup something like this:
/testforblock ~ ~ ~-1 minecraft:wool /testforblock ~ ~ ~-1 minecraft:wool /testforblock ~ ~ ~-1 minecraft:wool /testforblock ~ ~ ~-1 minecraft:wool etc... /say A Line
The first command would be a repeating command block while all other commandBlocks need to be conditional.
If you have a complete line the last command block (/say A Line) which also need to be conditional will run and only then.
1
make your maps using this...