Files
scripts/Perl Browse Links/extract_from_bookmarks.pl
2024-10-14 00:08:40 +02:00

36 lines
634 B
Perl

#!/usr/bin/perl
$in=$ARGV[0];
$out=$ARGV[1];
if ($ARGV[1] eq "") {
print "input und output Datei angeben!\n";
exit 1;
}
print "in $in\nout $out\n";
print "Suche nach Beginn\n";
open IN, "$in"; open OUT, ">>$out";
$s=0;
foreach (<IN>) {
chomp;
if ($_ =~ /<H3 ADD_DATE="[0-9]*" LAST_MODIFIED="[0-9]*">_____<\/H3>/) {
$s = 1; print "Beginn gefunden\n";
next;
}
if ($_ =~ /<H3 ADD_DATE="[0-9]*" LAST_MODIFIED="[0-9]*">.*<\/H3>/ and $s == 1) {
$s = 2; print "\nEnde gefunden\n";
}
if ($s == 1) {
print ".";
($a) = $_ =~ /href="(.*?)"/i;
printf OUT "$a\n";
}
if ($s == 2) {
close IN; close OUT;
exit 0;
}
}