How to split a file that has a repeating column header

Using csplit we can take a single file `policies.txt` and break it into multiple files. In this case csplit looks for any line beginning with the numbers 0-9 and creates a new file for each section. Think of this like taking a book and spiting it into several chapters:

csplit -k policies.txt ‘/^[0-9]/’ {99}

Leave a Reply

Your email address will not be published. Required fields are marked *