Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: Calendar / Scheduler in Perl

by blue_cowdawg (Prior)
on Apr 25, 2013 at 17:40 UTC ( #1030710=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Calendar / Scheduler in Perl
in thread Calendar / Scheduler in Perl

This should give you a starting point.

#!/usr/bin/perl -w use strict; my $OldIFS = $/; $/="**"; my ($taskList,$assigns)=<DATA>; chomp($taskList); $/=$OldIFS; my @tasks=split(/[\n]/,$taskList); my $timeline={}; foreach my $task(@tasks){ $timeline->{$task}=[]; } my @resourceList=split(/[\n]+/,$assigns); foreach my $assign(@resourceList){ my($resource,$theTasks)=split(/[\=]/,$assign); next unless $resource; # Deal with empty lines $resource =~ s/\s+$//; $theTasks =~ s/^\s+//; $theTasks =~ s/\s+$//; my @tasks=split(/[\s]+/,$theTasks); foreach my $task(@tasks){ push @{$timeline->{$task}},$resource; } } foreach my $key(sort keys %$timeline){ printf "%s\t%s\n",$key,join(",",@{$timeline->{$key}}); } exit(0); __END__ Task1 Task2 Task3 Task4 Task5 ** Joe Blow = Task1 Sally Brown = Task1 Task2 Jane Doe = Task3 Task5 Sid Down = Task2 Task4 Hoof Hearted = Task1 Task5


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg


Comment on Re^3: Calendar / Scheduler in Perl
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1030710]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2014-08-30 02:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls