#!/usr/bin/perl #problem: variables such as dimension[a-z]* -> will trigger parser/mapping use strict; print "Enter the path to your TM1 server data folder: "; my $dirname = ; chomp($dirname); opendir THISDIR, $dirname or die "Cannot open $dirname $!\n"; open(FLR, "> mychores.txt") or die "Cannot create output file mychores.txt!\n"; print FLR "ACT / date-time / frequency / chore name\n"; while (my $thisfile = readdir THISDIR) { my $status = " "; my $name = ""; my $frequency = ""; my $datetime = ""; open(FLH, "$dirname/$thisfile"); if ($thisfile =~ /(.*)\.cho$/i) { $name = $1; while () { if (/^530,(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/) { #date time $datetime = "$1/$2/$3 $4:$5:$6"; } if (/^531,(\d\d\d)(\d\d)(\d\d)(\d\d)/) { #frequency $frequency = "$1d $2h $3m $4s"; } if (/^533,(\d)/) { #status $status = " X " if ($1 == 1); } } print FLR "$status $datetime $frequency $name\n"; } close FLH; } close FLR;