#!/usr/bin/perl use strict; use warnings; # Parser einbinden my $osmolt_file = $ARGV[0]; my $result_file = $ARGV[1]; my $count_lines = 0; my $count_ctimes = 0; ReadData(); # Filter anlegen sub ReadData { #Filterdatei oeffnen open( FH, $osmolt_file ) or die( "$osmolt_file: $!" ); open (my $out, ">", $result_file) || die ("Can't open html output file: ".$result_file) ; my $count = 0; my $desc = ""; #fuer jede Zeile while( ) { chomp; # Newlines loeschen s/^\s+//; # fuehrende Leerzeichen entfernen s/\s+$//; # nachfolgende Leerzeichen entfernen next if( /^#/ ); # Kommentare ueberspringen next if( /^s*$/ ); # Leerzeilen ueberspringen if ($count != 0) { #Zeile auftrennen my($point,$title,$attributes,$icon,$icon_size,$iconOffset) = split( /\t/, $_, 7 ); print $point." - ".$attributes." * "; $count_lines++; print $attributes; if (length $attributes > 0 ) { $desc="Es liegen Daten vor !!!!"; } else { $desc="keine Leerungszeiten vorliegend!"; } print $out $point."\t".$title."\t".$desc."\t".$icon."\t".$icon_size."\t".$iconOffset."\n"; } else { # einfache Datenweitergabe der Kopfzeile print $out $_."\n"; } #Anzahl der eingelesenen Zeilen $count++; }# end-while close( FH ); close $out; }