Thread Zeilen löschen
(16 answers)
Opened by NitroXpress at 2016-02-13 12:13
Ich komm nicht drauf...
Hier der Code: Code (perl): (dl
)
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 use strict; use warnings; open INPUTFILE, "<", "filter.gcode" or die $!; open OUTPUTFILE, ">", "composition.gcode" or die $!; my @data = <INPUTFILE>; for (my $i=0; $i <= $#data -1; $i++) { my @current = split(" ", $data[$i]); my @next = split(" ", $data[$i+1]); if ($current[2] eq $next[2]) { $data[$i] = undef; } print OUTPUTFILE $data; } close INPUTFILE; close OUTPUTFILE; print "done"; modedit Editiert von pq: code-tags hinzugefügt Last edited: 2016-02-13 19:00:44 +0100 (CET) |