Unanswered: AWK scripting - how to get back to beginning of input file
I need help with AWK file. I have first time writing it and have one problem. Please advise how i can solve it (if it possible in AWK as well).
I have input file (csv file). I need go to last line of file, get value of second column and save it to my variable.
After this i need to get back to begin of file and start read all lines and add my variable among fields.
All lines goes to new output file csv.
Here is my awk file:
This command i run script in unix:
tr -d "\015" < INPUT_FILE.csv | awk -F"," -fMY_SCRIPT.awk > OUTPUT_FILE.csv
How i can return carriage to begin of file, i.e to line 1 and read again after population my var ??