-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d452a30
commit 6fe24e4
Showing
3 changed files
with
60 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/perl | ||
|
||
use strict; | ||
use File::Basename; | ||
use Cwd; | ||
|
||
my $cwd = cwd; | ||
$cwd .="/"; | ||
|
||
my $pdfsdir = $ARGV[1] or die "Usage: $0 html_file pdfs_dir > outfile.html\n"; | ||
|
||
open IN,"$ARGV[0]" or die "No html input file given\n"; | ||
my ( $name0, $path0, $extension0 ) = fileparse ( $ARGV[0], '\..*' ); | ||
|
||
|
||
open OUT,">${name0}_repath.html" or die "Could not create file ${name0}_repath.html\n"; | ||
|
||
while(<IN>){ | ||
if(/a href="file:\/\/(\/\S+)$pdfsdir/){ | ||
$_ =~ s/$1/$cwd/; | ||
} | ||
print OUT; | ||
} | ||
close IN; | ||
close OUT; |