Another possibility is awk:
awk 'NR==FNR || FNR>7' person1.txt file1.txt > result.txt
This will process first person1.txt and then file1.txt. It will print the current line if either
- we are processing the first of the two files, where
NR(the per-fileglobal line-counter) is equal toFNR, the globalper-file line counter, or - the per-file line-counter is larger than 7 (which will only be a limitation when processing the second file, where
NRis now larger thanFNR)
You even can expand this to per-file specifications of lines to be skipped:
awk -- '--skip<=0' person1.txt skip=7 file1.txt skip=4 file2.txt >result.txt
You would then simply precede each file name with a variable assignment that sets the awk variable skip to the number of lines you want to have skipped from the respective input file. The awk program checks for each processed line whether this variable, if decremented by 1, falls below zero, which would indicate that the number of lines to be skipped has been reached. The condition would then be true, and the current line printed.
Notice that the -- "end-of-options" specifier is needed because the first command of the actual program starts with a --.