Hi,
i have a file from which i extracted 2nd column and put it into a variable Acct_Num . Now i need to extract first 3 digits from it and save in to other variable.
My Code is:
while read Record1
do
Acct_Num=`echo $Record1 | awk '{print $2 }'`
ID=`echo $Record1 | awk '{print substr($Acct_Num, 1, 3 ) }`
echo "ID is $ID"
echo "Acct_Num is $Acct_Num"
done < $REGSeqFileName
Code to extract 2nd column from file is working fine. But the code to extract first 3 digits from Acct_Num (ID) is not working fine .
Can anybody help me with this ASAP.