summaryrefslogtreecommitdiff
path: root/Tools/schnitt/cutall3.pl
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/schnitt/cutall3.pl')
-rwxr-xr-xTools/schnitt/cutall3.pl31
1 files changed, 31 insertions, 0 deletions
diff --git a/Tools/schnitt/cutall3.pl b/Tools/schnitt/cutall3.pl
new file mode 100755
index 0000000..6961666
--- /dev/null
+++ b/Tools/schnitt/cutall3.pl
@@ -0,0 +1,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";
+ }