Hi! I need help making batch file that will remove everything except two words.
So example.txt file looks like this (only 1 line is in file):[00:03:34] He Has A 100.0 Pound Shark And Broke Record.
AND I need to get this:
100.0 Shark
in output.txt
how could i do this? I tryes with tokens but i failed. Need Help! Thanks! :))
download gawk for windows then do this this assumes you know the position of the words you want in the file.
C:\test> gawk.exe "{print $5,$7}" file 100.0 Sharkwhile this assumes you don't know the positions but you know what you want to get.
C:\test> gawk.exe "{for(i=1;i<=NF;i++) if($i ~ /Shark/ || $i ~ /^[0-9.]+$/) {print $i} }" file 100.0 Shark
thanks but is it possible that in your second example : C:\test> gawk.exe "{for(i=1;i<=NF;i++) if($i ~ /Shark/ || $i ~ /^[0-9.]+$/) {print $i} }" file
100.0
Shark
are multiple words with unknow position. Like : shark, Dolphin, Blue Marlin
and that are, when found, printed in one line100.0 Shark
45.8 Dolphin
87.2 Blue Marlin???
of course, just put the words you want in the regular expression /Shark|Dolphin|Blue Martin/
thanks! :)
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |