Two variables in a for loop

Can we assign two variables in a for loop?

I have an input file:

000301|20100502
835101|20100502

I want to read this file in a for loop and assign values to two different variables.
I did this now but did not work

for STORE,RUNDATE in `awk -F\| '{print $1,$2}' inputfile

Any suggestions please?

no you can't..

while read line ; do
var1=`echo "${line}"|awk -F"|" '{print $1}'`
var2=`echo "${line}"|awk -F"|" '{print $2}'`
done < filename

Hi.

It's easier in a while loop (well, probably!)

$ cat WhileTest
while IFS=\| read A B; do
  echo A is $A
  echo B is $B
done < file1

$ cat file1
000301|20100502
835101|20100502

$ ./WhileTest
A is 000301
B is 20100502
A is 835101
B is 20100502

with for :

for record in $(<inputfile)
do
   STORE="${record%\|*}"
   RUNDATE="${record#*\|}"
   echo "[$STORE][$RUNDATE]"
done

Jean-Pierre.

Maybe

$ for i in `cat loopvar`
do
var1=`echo $i | cut -d'|' -f1`
var2=`echo $i | cut -d'|' -f2`
echo $var1 $var2
done
000301 20100502
835101 20100502
$