---------- Post updated at 01:23 PM ---------- Previous update was at 01:18 PM ----------
Have a small doubt .
While using an iterator , i need to take the fields as seen as below .
But the Iterator is not been displayed . Can you please help with this .
Not sure I understand your logics. You seem to want to put lines 1,2,3 from file EMAIL_REPORT.CSV into individual versions of temp_mail.txt. The first iteration of your loop is in vain, as NR will never assume 0, the value of your iterator. Still awk will read through your entire file!
Why don't you try sth like (on a recent bash/ksh shell)
while ((++ITERATOR <= COUNT)); do read LINE; echo $LINE >temp_mail.txt; ... done < EMAIL_REPORT.CSV