SUMMARY: parsing text file in KSH

From: egold@fsa.com
Date: Sat Jul 12 2003 - 10:34:17 EDT


thanks for all the replies to the question, here is the answer (it was to
use "read")

cat $FILE | while read ONE TWO THREE
do
    echo $ONE $TWO $THREE
done

>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,
>_______________________________________________
>sunmanagers mailing list
>sunmanagers@sunmanagers.org
>http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:26:45 EDT