Hi jone kim
I'm not sure what you wanted, in my first code above, I assumed you wanted to extract the columns into separate variables and then use these variables with awk.
In this example, we use awk to store the variables and then have other programs use the variables
Code:
#!/bin/bash
while read line
do
var1=$(awk -F\| '{ print $1 }' <<< "$line")
var2=$(awk -F\| '{ print $2 }' <<< "$line")
echo "$var1 $var2"
done < file.txt
In this simple example the echo command is using the variables.