Help with Split Command

Hi All,

I have a txt file which I would like to partition into 2 separate output files. I would like to partition the odd or even groups of 4 lines from the txt file. So I would like lines 1-4 to go to file1, and lines 5-8 to go to file2, and so on until the whole txt file is divided into two files, the odd lines (1-4, 9-12, etc...) output file1 and the even lines (5-8, 13-16, etc...) output file2.

Can anyone recommend a Split command to do this?

Best,

Jos

Try

awk '{print > ("outfile" int((NR-1)/4)%2+1 )}'  file