Discussion: V-Card split script
Afficher un message
Vieux 13/03/2008, 22h30   #5
pk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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.

  Réponse avec citation
 
Page generated in 0,05122 seconds with 9 queries