awk -F, 'NR>1 && NR <10 {$8="abc";}1' OFS=, x.csv > y.csv
Above command is replacing 8th column of x.csv file to string abc for line number 1 to 10 successfully. But i want to pass starting line number (which is 1) with command line argument in shell script. How can i do that?
I tried to write a script but got no result
echo "first parameter is $1"
awk -F, 'NR>$1 && NR <10 {$8="abc";}1' OFS=, x.csv > y.csv