--------------------------------Linux Guide---------------------------------- by Ingo Blechschmidt (c) 2002 ----------------------------------------------------------------------------- ------------------------- HTML-Markups in Text umsetzen ------------------------- Sam Jun 16 13:09:43 MEST 2001 ------------------------- HTML Markup HTML_Markups Konvertierung_von_HTML_in_Text HTML-Eingine Lynx ----------------------------------------------------------------------------- Sie haben eine Website und wollen Sie in Text umsetzen - aber an Formatierung soll so viel wie möglich borhanden bleiben. ----------------------------------------------------------------------------- Hier funktioniert ein kleines Perl-Skript, aufgerufen mit perl -w htmlweg.pl oder, nach vorherigem chmod +x htmlweg.pl, ./htmlweg.pl. Das Skript liest das HTML-Dokument von der Standardeingabe, und gibt das Textdokument an der Standardausgabe aus. siehe <"down/htmlweg.pl">Download. --------CODE--------: htmlweg.pl #!/usr/bin/perl -w # htmlweg.pl - Entfernt HTML-Code aus Textdateien, beachtet aber bestimmte # - Formatierungen # Copyright (C) 2001 by Ingo Blechschmidt # Sam Jun 16 13:09:43 MEST 2001 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Ingo Blechschmidt # Arberstraße 5 # 86179 Augsburg # E-Mail: iblech@web.de, http://www.way.to/uselinux/ # Tel.: +49 / 821 882955 # # @html = ; die "./htmlweg.pl: Kann keine Verbindung mit grep herstellen!"; foreach $h (@html) { $h =~ s//---------------- Bild --------------/g; # $h =~ s/
/\n/g; $h =~ s/
//g; $h =~ s/ä/ä/g; $h =~ s/ö/ö/g; $h =~ s/ü/ü/g; $h =~ s/Ä/Ä/g; $h =~ s/Ü/Ü/g; $h =~ s/Ö/Ö/g; $h =~ s/ß/ß/g; $h =~ s/*<\/a>//g; $h =~ s///g; $h =~ s/<\/em>//g; $h =~ s/
    |<\/ol>|