filtering input from read command

I need help understanding a script I'm modifying which someone else has written. Basically I�m looping through a buffer that holds records fetched from a database query. I need a way to separate the primary key values from other attributes in the result. Heres the code:

BUFF=buffer_file
[query results] > $BUFF
{
   while read row
   do
       rowID= $(row#*|)   #??
       rowCol=$(row%*|)        #??
   done
} < $BUFF

I think the last > is probably supposed to be a <.

this table of string operations explains what those mean among many more, assuming you're using a bourne or ksh shell.

Assuming the number of columns is always the same, there's probably a better way to do this too.

I agree

Is the number of columns always the same, though? Hard to offer suggestions when I don't know what the input and output is supposed to be.

Sorry for not specifying. I'm using bourne and yes the collumns are always the same (only two). Output from the query would look something like this:
1 server001
2 server002
3 server003

---------- Post updated at 12:47 PM ---------- Previous update was at 12:45 PM ----------

I seem to have found a solution that has been working but may not be the best immplementation:

rowID=$(echo $row | awk '{print $1}')
rowCol=$(echo $row | awk '{print $2}')

Easy peasy. read does this all by itself.

while read rowID rowCol
do
        echo "rowID=$rowID rowCol=$rowCol"
done < filename

If the separator was | instead of whitespace you'd just do

while IFS="|" read rowID rowCol
do
        echo "rowID=$rowID rowCol=$rowCol"
done < filename

This builtin is hundreds of times faster than calling awk for individual lines.