using 'set' variables that are gawk one liners
i am writing a short bat file that contours a xyz file with GMT utilities (gener开发者_JS百科ic mapping tool) i want to read the max and min file and use it later in the bat file what i did is
set max_color=gawk "BEGIN {max = 0} {if ($3>max) max=$3} END {print max}" %file%
set min_color=gawk "BEGIN {min = %max_color%} {if ($3'<'min) min=$3} END {print min}" %file%
but when i try reading it later
makecpt -Crainbow -T%min_color%/%max_color%/10 > conc.cpt
instead of reding the value it has the whole gawk one liner
how can i set a valueuse a for loop to get the results of the gawk command, eg
for /f %%a in ('your gawk command') do (
set var=%%a
)
精彩评论