parsing text file in KSH

2007-12-25 1:39:00

This is probably an easy question so go ahead and blast me with you emails
about too easy a question.

I have a text file that looks like this:

a b c
d e f
g h i

in korn shell i want create a loop to parse this file so that for each loop
i read one line and assign the 3 columns to variables,
so in the first loop i want the variables to equal:

ONE=a TWO=b THREE=c

the second loop will have the vaules:

ONE=d TWO=e THREE=f

the 3rd loop will assign the values:

ONE=g TWO=h THREE=i

I only want to do this in korn shell, i tried awk and got close but no
cigar.

thanks in advance,

Comments

Got something to say?

You must be logged in to post a comment.