Split a large textfile (one file) into multiple file to base on ^L

Hi,

Anyone can help, I have a large textfile (one file), and I need to split into multiple file to break each file into ^L.

My textfile

==========

abc company
abc address
abc contact
^L
my company
my address
my contact
my skills
^L
your company
your address

==========

Need an output like in 3 files ( filename1.txt, filename2.txt, filename3.txt)

1) output filename1.txt

abc company
abc address
abc contact

2) output filename2.txt

my company
my address
my contact
my skills

3) output filename3.txt

your company
your address

Thank you in advance.

Regards,
FSPalero

Any attempts/ideas/thoughts from your side?

Is that a literal ^L string (two char sequence), or is it a control char <CTRL>L (form feed, 0X0C)?

---------- Post updated at 11:10 ---------- Previous update was at 11:08 ----------

And, is it on a line of its own, or is it dispersed in the text?

---------- Post updated at 11:55 ---------- Previous update was at 11:10 ----------

Howsoever, try

awk -vRS=$'\f' '{gsub ("^\012", ""); print > "filename" NR ".txt"}' ORS="" file
cf *.txt
filename1.txt:
abc company
abc address
abc contact
filename2.txt:
my company
my address
my contact
my skills
filename3.txt:
your company
your address

Hi.

See also:

NAME
       csplit - split a file into sections determined by context lines

SYNOPSIS
       csplit [OPTION]... FILE PATTERN...

DESCRIPTION
       Output  pieces of FILE separated by PATTERN(s) to files 'xx00', 'xx01',
       ..., and output byte counts of each piece to standard output.

There are more than 100 threads here that mention csplit , many with demonstrations.

Best wishes ... cheers, drl

hi,

thank you for the response, i forgot to say thank you for you guys. rudic, you gave a good solution for me. many many thanks

regards,
fspalero