Splitting up a file

S

Stuart Clarke

Hey,

I have a quick question about breaking up a file into smaller files.

I have a large file, quite like an mbox file in how it stores its data
for example

DATA
stuff
stuff

DATA
stuff

DATA
stuff
stuff

I don't want this information in one file, I want to break it up into
single files, so the example above would give me three files. How would
you suggest I go about this?

Any help is greatly appreciated.

Thanks
 
J

Jesús Gabriel y Galán

I have a quick question about breaking up a file into smaller files.

I have a large file, quite like an mbox file in how it stores its data
for example

DATA
stuff
stuff

DATA
stuff

DATA
stuff
stuff

I don't want this information in one file, I want to break it up into
single files, so the example above would give me three files. How would
you suggest I go about this?

If you are on linux, you can use csplit:

csplit testsplit.txt /DATA/ "{*}"

(this will generate files named xx00, xx01, etc).

Jesus.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,087
Latest member
JeremyMedl

Latest Threads

Top