将 Grindstone 3 数据导出到 iCalendar 文件

将 Grindstone 3 数据导出到 iCalendar 文件

有没有办法将 Grindstone 3 数据导出到iCalendar 文件

对于 Grindstone 2,我使用的是 Perl脚本

#!/usr/bin/perl

$xmlfile = @ARGV[0];
if ( ! $xmlfile ) { print "Usage: $0 grindstone_export.xml\n" ; exit 0 }

$icsfile = $xmlfile;
$icsfile =~ s/\.xml$/.ics/g;

open (ICSFILE,">$icsfile");
print "Writing to $icsfile\n";
print ICSFILE "BEGIN:VCALENDAR\n\n";
open (XMLFILE,$xmlfile);
while (<XMLFILE>) {
        $line = $_;
        if (/<task name/){
                @fields = split('"',$line);
                $summary = @fields[1];
        }
        if (/<time end/){
                @fields = split('"',$line);
                $end = @fields[1];
                $start = @fields[9];

                $start =~ s/-|://g;
                $end =~ s/-|://g;

                # print "$start\t$end\t$summary\n";
                print ICSFILE "BEGIN:VEVENT\n";
                print ICSFILE "DTSTART:$start\n";
                print ICSFILE "DTEND:$end\n";
                print ICSFILE "DTSTAMP:$start\n";
                # print ICSFILE "UID:\n";
                print ICSFILE "CREATED:$start\n";
                # print ICSFILE "DESCRIPTION:\n";
                print ICSFILE "LAST-MODIFIED:$end\n";
                # print ICSFILE "LOCATION:\n";
                # print ICSFILE "SEQUENCE:0\n";
                print ICSFILE "STATUS:CONFIRMED\n";
                print ICSFILE "SUMMARY:$summary\n";
                # print ICSFILE "TRANSP:OPAQUE\n";
                print ICSFILE "END:VEVENT\n\n";
        }
}
close (XMLFILE);
print ICSFILE "END:VCALENDAR\n";
close (ICSFILE);

但它只适用于 Grindstone 2 的 XML 文件。

我将 Grindstone 3 与 Windows 7 SP1 x64 Ultimate 一起使用。

答案1

没有预先构建的方法将 Grindstone 3 数据导出到 iCalendar 文件。

相关内容