Issue
Is there a way to determine whether the current line is the last line of the input stream?
Solution
You've got two options, both kind of messy.
- Store a copy of every current line in a temp variable, and then use the END block to process it.
- Use the system command to run "wc -l | getline" in the BEGIN block to get the number of lines in the file, and then count up the that value.
You might have to play with #2 a little to get it to run, but it should work. Its been a while since I've done any awk.
Answered By - SDGator Answer Checked By - Pedro (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.