awk -F, 'NR<101{$2="e";}1' OFS=, file
NRthe built-in variable gives you either the total number of records processed or the line number depending on usage. In the above awk example, the variable NRhas a line number. When you place the template NR<101, the action will be true for the first 100 lines. When it is false, the default will be 1, which will print the remaining lines as is.
source
share