I have a large dataset, I want to make multiple output file after reading every 4th row. For example after reading four (4) rows will have one dataset, such as 1st.out, 2nd.out, 3rd.out, etc.
Is there any single script which will do this. I can run awk multiple times to create each output dataset, however, this seems to be tedious.
Attached is an example dataset:
0.000116666 0.000116666 0.000116666 0.000125 0.000133333 0.000149999 0.000324999 0.000649997 0.000624998 0.000491665
0.000274999 0.000149999 0.000149999 0.000158333 0.000158333 0.000208333 0.000358332 0.000366665 0.000374998 0.000383332
0.000383332 0.000399998 0.000399998 0.000383332 0.000191666 0.000191666 0.000166666 0.000141666 0.000141666 0.000141666
0.000141666 0.000141666 0.000183333 0.000224999 0.000224999 0.000158333 0.000158333 0.000174999 0.000241666 0.000241666
0.000241666 0.000241666 0.000233332 0.000233332 0.000233332 0.000224999 0.000224999 0.000224999 0.000791664 0.00095833
0.000941663 0.000358332 0.000166666 0.000158333 0.000133333 0.000133333 0.000149999 0.000166666 0.000324999 0.000408332
0.000391665 0.000366665 0.000349999 0.000341665 0.000324999 0.000316665 0.000316665 0.000308332 0.000291666 0.000283332
0.000333332 0.000433332 0.000449998 0.000416665 0.000299999 0.000208333 0.000158333 0.000166666 0.000108333 3.33332e-005
Thanks.
Is there any single script which will do this. I can run awk multiple times to create each output dataset, however, this seems to be tedious.
Attached is an example dataset:
0.000116666 0.000116666 0.000116666 0.000125 0.000133333 0.000149999 0.000324999 0.000649997 0.000624998 0.000491665
0.000274999 0.000149999 0.000149999 0.000158333 0.000158333 0.000208333 0.000358332 0.000366665 0.000374998 0.000383332
0.000383332 0.000399998 0.000399998 0.000383332 0.000191666 0.000191666 0.000166666 0.000141666 0.000141666 0.000141666
0.000141666 0.000141666 0.000183333 0.000224999 0.000224999 0.000158333 0.000158333 0.000174999 0.000241666 0.000241666
0.000241666 0.000241666 0.000233332 0.000233332 0.000233332 0.000224999 0.000224999 0.000224999 0.000791664 0.00095833
0.000941663 0.000358332 0.000166666 0.000158333 0.000133333 0.000133333 0.000149999 0.000166666 0.000324999 0.000408332
0.000391665 0.000366665 0.000349999 0.000341665 0.000324999 0.000316665 0.000316665 0.000308332 0.000291666 0.000283332
0.000333332 0.000433332 0.000449998 0.000416665 0.000299999 0.000208333 0.000158333 0.000166666 0.000108333 3.33332e-005
Thanks.