Dear community,
I'm quite a newbie with scripting, I have this problem:
I have a file with many lines and I want to copy the lines from 1 to N to file.1, from N+1 to 2N to file.2, and so on up to the end of the file
I have tried with something like this (N=43 in this example):
awk '{for (i=1;i<=1000;i++) if ((NR>=$i43 -42)&&(NR<=$i43)) print $0}' big_file >> file.$
but it doesn't output anything, neither does the following:
for ((i=1;i<=1000;i++))
do
awk '{ if ((NR>=$i43 -42)&&(NR<=$i43)) print $0}' big_file >> file.$
done
I've tried other ways, they all failed... do you have any suggestion?