9to6linux.com
Covering latest Linux News, Tutorials, Reviews and more

Splitting files on Linux by context

The csplit command is unusual in that allows you to split text files into pieces based on their content. - Community submission by Editor (9to6linux) on

Splitting files on Linux by context

Splitting files on Linux by context

The csplit command is unusual in that allows you to split text files into pieces based on their content. The command allows you to specify a contextual string and use it as a delimiter for identifying the chunks to be saved as separate files.

The csplit command is unusual in that allows you to split text files into pieces based on their content. The command allows you to specify a contextual string and use it as a delimiter for identifying the chunks to be saved as separate files.

As an example, if you wanted to separate diary entries into a series of files each with a single entry, you might do something like this.