This awk '{print $3}'
will print a list of :
from your sample file, not the numbers. You should have used $4
. Or, you are showing us the wrong file format here.
The exact Windows equivalent of that Awk script is:
FOR /F "tokens=4" %%a IN (file.txt) DO ECHO %%a
But then the required output you showed 8, 7, 9
isn't what your Awk script prints either.
The simplest batch command producing output close to that is:
FOR /F "tokens=4" %%a IN (file.txt) DO <nul SET /p="%%a, "
If you really can't stand the extra comma in the end, it gets more complicated:
SETLOCAL
FOR /F "tokens=4" %%a IN (file.txt) DO <nul CALL SET /p=%%,%% %%a& SET ,=,
AWK on Windows
By the way, Awk is available for Windows. Quoting is different, so your script would be:
awk "{printf $4 \", \"}" file.txt
Or to get rid of that extra comma, it becomes slightly more messy:
awk "{printf (NR>1?\", \":\"\") $4}" file.txt