将Grindstone 3数据导出到iCalendar文件


1

有没有办法将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。


您能否提供有关Grindstone 3用于存储数据的格式的任何信息?
ebpa

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.