summaryrefslogtreecommitdiff
path: root/Tools/schnitt/cutall3.pl
blob: 69616669709d57deae927c5a1e17188f2e84266b (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
#!/usr/bin/perl

open (FI,"cut") or die "Kann Cut-Datei nicht oeffnen\n";

outer: while (<FI>)
  {
    chomp;
    if (! ($_ > 1 || $_ eq "0"))
      {
	open (FO,">cut2");
	print FO "$_\n";
	while (<FI>)
	  {
	    chomp;
	    if ($_ > 1 || $_ eq "0")
	      {
		print FO "$_\n";
	      }
	    else
	      {
		system ("cutt");
		redo outer;
	      }
	  }
      }
  }
if ( -f "cut2")
  {
    system ("cutt");
    unlink "cut2";
  }