I am trying to replace every instance of a block of six rows with another block of six rows, just reducing the six rows block of two columns to a six rows block of only one column.
Thank you to your comments I'll write this question more clearly. I have several guitar tablature text files each with many "lines" of music. Each "line" of music has 6 (as the guitar number of strings) consecutive rows of text. Between the "lines" of music there are empty (or with some text) lines. Normally these six row "lines" are about two hundred columns length, and I want to reduce the length of the lines by replacing each six vertical row of -- by a six vertical row of -.
As an example. I would like to reduce the first chunk to the second.
|------------------| |-------|
|------------------| |-------|
|-0----------------| |-0-----|
|-2-----2-----2----| |-2-2-2-|
|-------2----------| |---2---|
|-------------0----| |-----0-|
I have tried the following code (seen on unix.stackexchange 1) without success:
sed -i '/--/,/--/,/--/,/--/,/--/,/--/c\
-\
-\
-\
-\
-\
-' a.txt
I have had no better results with awk or vim or perl.
A partial solution, for example using awk with Field Separator empy, would be: find two consecutive columns all whose characters are either empty or "-". Then delete one of the two columns. But I do not know how to do it.