#!/usr/bin/perl # (C) 2011 by Jan Theofel # Programm darf kostenfrei weitergegeben werden, solange es unveraendert belibt. # Original unter http://www.theofel.de/g/vgwort use strict; my $infile = shift(); my $outfile = shift(); print "vgwort-konvert.pl\n"; print "Konverter fuer einfachere Nutzung der METIS-Dateien der VG WORT\n"; print "Weitere Informationen unter http://www.theofel.de/g/vgwort\n"; print "(c) 2011 by Jan Theofel\n"; if($infile eq "" or $outfile eq "") { die "usage: $0 infile outfile\n"; } open(IN,"<$infile") || die "error: can't read $infile: $!"; open(OUT,">$outfile") || die "error: can't read $outfile: $!"; # skip first 5 lines ; ; ; ; ; while() { # skip content of each first line my ($trash,$img) = split(/;/, ); # first element of next line my ($trash,$trash,$id) = split(/;/, ); # first element of next line $img =~ s/>/ \/>/; print OUT $img . "\t" . $id . "\n"; } close(OUT); close(IN); print "\n\nKonvertierung durchgefuehrt. Ausgabedatei $outfile erstellt.\n";