While loop help need

I have these following data about 100 row and the data is seperated by a space between each column:

5 4 0
3 7 1
9 8 7

I want to create a while loop that produce the results below:

mydata
xyz
a = 5
b = 0
c = 4
ax(1)=3
bx(1)=7
cx(1)=
dx(1)=1
ex(1)=
fx(1)=
finish
finish
ax(2)=9
bx(2)=8
cx(2)=
dx(2)=7
ex(2)=
fx(2)=
finish
finish

Please let me know if you can help!!

Yea, I'm sure someone could help. What the heck is this used for? I can't think of a good reason to snag data like this off the top of my head.

It looks like an interesting homework problem though but you're not providing enough information. I can see why mydata is printed (data file name) and xyz must be the name of the script. If you only have three columns of data though, why are they placed in ax, bx, and dx and what's cx, ex, and fx used for? And why put "finish" at the end of the loop and why twice?

It's a puzzle.

Carl

the datafile have the following information:

5 4 0
3 7 1
9 8 7
________________________________________________

This the code:

cat datafile | while read datafile
do
echo anything
echo a = $datafile
echo b = $datafile
echo c = $datafile
done

________________________________________________
The results:

anything
a = 5 4 0
b = 5 4 0
c = 5 4 0
anything
a = 3 7 1
b = 3 7 1
c = 3 7 1
anything
a = 9 8 7
b = 9 8 7
c = 9 8 7

_____________________________________________

The What I want is:

anything
a = 5
b = 4
c = 0
anything
a = 3
b = 7
c = 1
anything
a = 9
b = 8
c = 7

___________________________________________

How can I do it? CAn anyone help??? Thanks!!! sorry for the confussion!