Hi all,
I have a genotype file containing 500K SNPs (i.e 500000 lines), I want to create groups of SNPs taken every 5K and store each group in seperate files. This means take SNPs 1-5000 and store in file 1(I want to keep the whole line), take SNPs 5001-10000 and store in file 2, take SNPs 10001- 15000 and store in file 3 and so on ....., in the end I should have 500 files! I know that I can do it to create a single group by using sed command in Unix like
sed -n 1,500p geno.file > out.file
but how can I do that sequentially to create all groups?
this is the first few lines of my genotype file.
HanXRQChr01 145635054 N N N T N N N N N N N
HanXRQChr01 145798243 N N N C N N N N N N N
HanXRQChr01 145823740 N N N N N N N N N N N
HanXRQChr01 145933533 N N N N N N N N N N N
HanXRQChr01 146276377 N N N N N N N N N N N
HanXRQChr01 146433063 N N N G N G N N N N N
Thanks in advance for any suggestion or help
Thank Pierre for giving me the hint. I had forgotten "split". Actually it was quite easy. I simply used $ split -n 5000 geno.file