I have the following string:
col1|col2|col3+++++++++++A|1|a B|2|b C|3|c D|4|d (3 rows)
I want to split this string so as to remove the string in the beginning till the last + symbol and then remove the tail end which is (XYZ rows)
so the string becomes
A|1|a B|2|b C|3|c D|4|d
Now, I want to split this string into multiple arrays that look like this
A 1 a B 2 b C 3 c D 4 d
so that I can iterate over each row using for loop to do some processing.
How can I do this using sed or grep?
I tried this for the first pass but it didn't work
echo $string | sed 's/([0-9])rows//' | sed 's/[^+]//'
but it didn't work.