I have a output which is not very well formatted and that causes the trouble in capturing variable value.
For example:
This is counter1 1000
this counter2 2000
this counter3 is higher value 3000
Now from above file I want to just capture 1000, 2000 and 3000. If I use awk with print $x where x = any value then it allocates the different values for each line.
If I use $4 then for first line I will be able to select 1000 but for 2nd line it will not provide any value and for third line it will print higher so I want to insert the field separator and read the variable. Any help is greatly appreciated!
If you only want last argument, and only if a number:
You could even trap the counter’s number (and so read only line containing
counterX):Or even for just locating separator:
or, or…