using split, can i break up a huge txt file using a regex

Polytropon freebsd at
Mon Oct 19 00:17:15 UTC 2009

On Fri, 16 Oct 2009 22:25:13 -0700, Gary Kline <kline at> wrote:
> I would like to put back the 
> 	huge text file into its 66 smaller files using split.  Can I break this 
> 	very large journeyTowardtheDawn.txt using the regex
> 	"Chapter [:digit:]{1,2}" ??
> 	Or maybe just "Chapter " ?

Maybe FreeBSD's csplit program is the right tool for this job.
It supports splitting files based on context; you can use
regex to express where a new file should be opened.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list