I have a rather large .msg file formatted in the UIEE format.
$ wc -l big_db.msg
8726593 big_db.msg
Essentially, the file is made up of entries of various length that look something like this:
UR|1
AA|Condon, Richard
TI|Prizzi's Family
CN|Collectable- Good/Good
MT|FICTION
PU|G.P. Putnam & Sons
DP|1986
ED|First Printing.
BD|Hard Cover
NT|0399132104
KE|MAFIA
KE|FICTION
PR|44.9
XA|4
XB|1
XC|BO
XD|S
UR|10
AA|Gariepy, Henry
TI|Portraits of Perseverance
CN|Good/No Jacket
MT|SOLD
PU|Victor Books
DP|1989
BD|Mass Market Paperback
NT|1989 tpb g 100 meditations from the Book of Job "This book...help you
NT| persevere through the struggles of your life..."
KE|Bible
KE|religion
KE|Job
KE|meditations
PR|28.4
XA|4
XB|5
XC|BO
XD|S
This is an examples of two entries, separated by a blank line. I wish to split this big file into smaller files without breaking an entry into two files.
Each individual entry is separated by a newline (a completely blank line) in the file. I wish to break this 8.7 million line file into 15 files. I understand that tools like split
exist but I'm not quite sure how to split the file but only have it split on a newline so a single entry doesn't get broken into multiple files.
csplit
also exists.|
(likeUR
,AA
,TI
) relevant for the count of files, even the same to be exact?