What you are trying to do is not at all clear. Are you trying to add a string to the end of the heading line or are you trying to add numbers to the ends of other lines in your file?
Why do you care how many fields are in a line in your file if all you are doing is adding a string (or a number) to the end of every line in a file?
What operating system are you using?
What shell are you using?
What code have you written to try to do this on your own?
yes this is a part of my homework but i don't know how to solve it. I think i don't need to count the field and just add to the end of the head line. I'm using linux Mint terminal.