I have a script that converts a file into an html table. This script works fine for a 1 column table. However, I'm trying to do this for a multi-column table. My input file will look something like this:
a b c
d e f
g h i
My script basically works by taking in each line and putting that value into an html tag using a while loop reading each line. Now I need to make the script read each value of each line. The number of columns will be set so I figured what I could do is just have some sort of loop that stores each value of a line into a variable and then use it to build my table. I'm just not sure how to do that.
Is there a way to get the first line and have say these variables set like this $1=a, $2=b, $3=c? Each line will always be space delimited. Any help would be much appreciated. Thanks!