From: Nicolas Boisselier Date: Wed, 25 Jan 2017 15:28:20 +0000 (+0000) Subject: bin/html-table2csv X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=79aa64982e4ec27f5f15cf0840e8dd9fb2927d7e;p=nb.git bin/html-table2csv --- diff --git a/bin/html-table2csv b/bin/html-table2csv index 470e9381..e46f2fdf 100755 --- a/bin/html-table2csv +++ b/bin/html-table2csv @@ -39,7 +39,7 @@ $main::_DATA_ = undef; # BEGIN # ################################################################################# -@ARGV = map {m,^\w+://, ? "curl -s '$_'" : $_} @ARGV if @ARGV; +@ARGV = map {m,^\w+://, ? "curl -s '$_' |" : $_} @ARGV if @ARGV; my $html = join('',<>); $html =~ s/\s+/ /g; @@ -54,6 +54,7 @@ for my $table ($html =~ m,]*>(.*?)<\s*/\s*table\s*>,gi) { for my $td ($tr =~ m,]*>(.*?)<\s*/\s*t[dh]\s*>,gi) { $td = html2txt($td); + $_ = chr(194).chr(160); $td =~ s/$_/ /g; $td =~ s/\s+/ /g; $td = str_trim($td); push(@col,$td);