It doesn't just have to white space between fields. In can be anything as long as you set the appropriate field separator. Eg:
The : after the -F tells us that : is the input field separator. Change this as appropriate.
What if there are multiple characters you wish to use as field separators? After the -F just list all of the characters in square brackets. For example:
To use the value of a bash variable. You have to use the -v switch to import it. The syntax is:
Now you can use awkvar in your awk statements which will have the value of bashvar. Remember you CANNOT change the value of a bash variable using AWK.
you can use printf modifiers to specify the output of numbers, for example
printf "%.02f",a/b