I\'m trying to get the values in column X at lines 5 to 5 + Y. I\'m guessing there\'s a quick way to do this with awk. How is this done?
awk
I think this will work for you, untested:
awk 'NR >= 5 && NR <= 5 + Y { print $X }' file.txt
Obviously, substitute X and Y for some real values.
X
Y
EDIT:
If X and Y are shell variables:
awk -v column="$X" -v range="$Y" 'NR >= 5 && NR <= 5 + range { print $column }' file.txt