Im going to use this awk script to delete duplicate lines from my text file:awk '!x[$0]++'However, I want to specify which lines that they are to be run on. There could be 10000 duplicates, but I would only want to remove the duplicates from lines 10020 to 10030.In my case it is 24 to 655. It would have been easier if it would have been words where I could {$24, $655} (or something similar). But I'm not sure how to specify lines in this case. If it is important, I'm using awk version 20070501.
Specify lines in awk?
text processing;awk
You could do something like this:awk -v low=24 -v high=655 'NR >= low && NR <= high{if (!a[$0]++) print; next};{print}' fileor better still awk -v low=100 -v high=200 'NR < low || NR > high || !a[$0]++' test.file