Re: V-Card split script
ChrisOD wrote:
> I have a 13Mb vcf file and would love to split this into it's
> component parts.
>[cut]
> I'd like to have the seperate .vcf files named on the N field
> with a syntax like: LastName-FirstName.vcf
>
> Hope someone can give some hints to a script newbie.
Besides awk, another way is to use csplit (assuming max 100000 vcards):
$ csplit -n 5 -z vcard.txt '/BEGIN:VCARD/' '{*}'
This is not really useful by itself since you don't have much control over
file names.
However, you can use a subsequent loop to rename all the files.
--
All the commands are tested with bash and GNU tools, so they may use
nonstandard features. I try to specify when something is nonstandard (if I
know that), but I may still miss something. Corrections are welcome.
|