I have an oracle database query in a ksh script which returns the result set as a string. To separate the columns I add a pipe and a ! at the end of each row.

So I have a string like:

1111~row1 value!
2222~row2 value!
3333~row4 value!
4333~row 5 value!

I want to split on ! to have an array of, in this case, 4 values. Then I figure I can iterate through each one and pull out the pipe...