summaryrefslogtreecommitdiff
path: root/Tools/master-timer/convert-oldtorecord.pl
blob: 853c20bab62d5d66a8884983f6141e4c849a4cfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/perl

while (<>)
  {
    chomp;
    if ($_ && !(/^\#/))
      {
	($title, $subtitle, $description, $channel, $timeframe, $prio, $timer_title, $margin, $machine) = split (/\|/,$_);
	
	if ($timer_title) {
	  print "[$timer_title]\n";
	} elsif ($title) {
	  print "[$title]\n";
	} elsif ($subtitle) {
	  print "[$subtitle]\n";
	} elsif ($description) {
	  print "[$description]\n";
	} else {
	  die ("Illegal Format");
	}
	
	# Accept torecord only if it is for the current machine
	if ($title)
	  {
	    print "Title = $title\n";
	  }
	if ($subtitle)
	  {
	    print "Subtitle = $subtitle\n";
	  }
	if ($description)
	  {
	    print "Description = $description\n";
	  }
	if ($channel)
	  {
	    print "Channel = $channel\n";
	  }
	if ($timeframe)
	  {
	    print "Timeframe = $timeframe\n";
	  }
	if ($prio)
	  {
	    print "Prio = $prio\n";
	  }
	if ($timer_title)
	  {
	    print "Timertitle = $timer_title\n";
	  }
	if ($margin)
	  {
	    print "Margin = $margin\n";
	  }
	if ($machine)
	  {
	    print "Instance = $machine\n";
	  }
	print "\n";
      }
  }