Created
August 21, 2019 17:17
-
-
Save HakierGrzonzo/683209f83accfac48b8550cb880290c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Program VcardDiv; | |
uses crt; | |
var | |
i:Longint; | |
Filepath,str:string; | |
source,dest:textfile; | |
Begin | |
writeln('VcardDiv v0.1'); | |
writeln('enter source filename:'); | |
readln(Filepath); | |
try | |
begin | |
assign(source,Filepath); | |
reset(source); | |
i := 0; | |
repeat | |
readln(source,str); | |
case str of | |
'BEGIN:VCARD' : begin | |
assign('./result/Card'+inttostr(i)+'.vcf',dest); | |
rewrite(dest); | |
writeln(dest,str); | |
i := i+1; | |
clrscr; | |
writeln('VCARD no: '+inttostr(i)) | |
end; | |
'END:VCARD': begin writeln(dest,str); closefile(dest); end; | |
else | |
begin | |
writeln(dest,str); | |
end; | |
end; | |
until eof(source); | |
writeln(inttostr(i)+' cards split'); | |
writeln('The split cards were saved in ./result'); | |
closefile(source); | |
end; | |
except | |
on E: Exception do | |
writeln( 'Error: '+ E.ClassName + #13#10 + E.Message ); | |
end; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment