How can I split a CSV file linewise, retaining headers in both output files?

Subscribers:
4,130
Published on ● Video Link: https://www.youtube.com/watch?v=v_RSmX_iPAw



Duration: 3:05
3 views
0


How can I split a CSV file linewise, retaining headers in both output files?
I hope you found a solution that worked for you :)
The Content (except music & images) is licensed under (https://meta.stackexchange.com/help/licensing)CC BY-SA |
Thanks to all those great people for their contributions!

(unix.stackexchange.com/users/544815/kumar)kumar |
(unix.stackexchange.com/users/40482/bxm)bxm |
(unix.stackexchange.com/users/195582/aborruso)aborruso |
(unix.stackexchange.com/users/409939/andrew-ray)Andrew Ray |
A special thanks goes out to the (https://unix.stackexchange.com/questions/720634/how-can-i-split-a-csv-file-linewise-retaining-headers-in-both-output-files)Stackexchange community |

I wish you all a wonderful day! Stay safe :)







Tags:
csv
linux
shell
shell-script