我在mhtml文件中有以下数据集(来自测量设备)。该文件的结构始终相同(例如,其格式与数据中的格式始终相同)。现在理想的目标是:
基本上,我需要分析数据,因此我需要在Excel工作表中使用它们。
事实是,数据的“ blob”不是表格形式,因此“ html_table”不起作用(它基本上在最后一个表格单元格中)。可悲的是,以下解决方案也不起作用,因为表函数将其拧紧(在没有表的情况下也可以正常工作):
library(magrittr)
makeHTML2Table <- function(text)
{
text %>% gsub("\\s|=|#","",.) %>% str_split(.,"<br>") %>% unlist %>% gsub(" ","",.) %>% gsub("^;+|;+$","",.) %>%
str_split(.,pattern = ";+") %>% data.table::transpose(.) %>% data.table::transpose(.) %>% do.call(rbind,.)
}
makeHTML2Table(bigString)
(感谢Andre Elrico在这里的帮助)
有人对如何解决此问题有想法吗?
数据:
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="=_nextpart_of_BAUR_MHTML";
type="text/html"
X-MimeOLE: Producted by BAUR.
This is a multi-part message in MIME format.
--=_nextpart_of_BAUR_MHTML
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Content-Location: file://C:\BaurMeasure\Ax00E4nde_21152 VB_20180124120429\A=e4nde | 2/7 A=e4nde | 2/1152 B=
s.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>A=e4nde | 2/7 Al=e4nde | 2/1152 B=
s</title>
</head>
<body>
<p style=3d" text-align:right">
<img src=3d"file:///=
C:/BaurSoftware/daten/Kaernten-Netz-Logo+Endorsement-4C.png =
" width=3d20% alt=3d""> </p>
<p style=3d"margin-left:70%;text-align:center;
font-family:Arial; font-size:10pt; font-style:normal; text-decoration:none"><br></p><hr noshade>
<p style=3d"text-align:center;
font-family:Arial; font-size:24pt; font-style:normal;font-weight:bolder;
text-decoration:none; color:#000000">td</p><p> </p>
<table align=3dcenter>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:16pt; font-style:normal;font-weight:bolder;=
text-decoration:none; color:#000000">
Projekt
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal; text-decoration:none">
</p>
</td>
</tr>
</table>
<table align=3dcenter>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>Name des Projektes: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
Al=e4nde
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>Zusatzinformation: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>Von S: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
2/7 Al=e4nde
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>Nach S: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
2/1152 B
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b> </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>Zeit: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
12:58
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>Datum: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
XXXXX
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b> </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>Name des Pr=fcfers: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
abc
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>Kommentar: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
Mantelpr=fcfung durchgef=fchrt:<br><br>L1: 20=b5A<br>L2: 12=b5A<br>L3: =
4=b5A
</p>
</td>
</tr>
</table>
<p> </p>
<table align=3dcenter>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:16pt; font-style:normal;font-weight:bolder;=
text-decoration:none; color:#000000">
Kabeldaten
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal; text-decoration:none">
</p>
</td>
</tr>
</table>
<table align=3dcenter>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>ID: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>Typ: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
dta
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>Hersteller: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>Nennspannung: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
20
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>Anzahl der Phasen: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
3
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>Phasenbezeichnung: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
L1
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b> </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
L2
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b> </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
L3
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>Verlegejahr: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
1981
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>L=e4nge: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
154.0 m
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i><b>Ausbreitungsgeschwind.: </b></i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
80.1 m/us
</p>
</td>
</tr>
</table>
<p style=3d"page-break-after:always"> </p>
<hr noshade>
<p style=3d"text-align:center;
font-family:Arial; font-size:16pt; font-style:normal;font-weight:bolder;
text-decoration:none; color:#000000">Messung</p><p style=3d" text-align:center">
<img src=3d"file:///c:/BaurSoftware/daten/TDBitmap0.png =
" width=3d100% alt=3d"TD Measure"> </p>
<p style="border-width:3px;border-style:solid;border-color:#FFFF00;padding:10;text-align:center;font-family:Arial;font-size:16pt;font-style:normal;font-weight:bolder;text-decoration:none;color:#000000">Cable with operating risk!</p><p style=3d"text-align:center;
font-family:Arial; font-size:12pt; font-style:normal;font-weight:bolder;
text-decoration:none; color:#000000">Auswertung</p><table align=3dcenter>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<b>Name der Auswertung</b>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
XLPE
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i>Kriterium</i>
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
<i>Kommentar</i>
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
TD(n+1)-TD(n) > 0.0
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
Cable with very high operating risk. Measurement cancelled!
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
TD(n) > 0.0
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
Cable with very high operating risk. Measurement cancelled!
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
TD(n+1)-TD(n) > 1.0
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
Cable with high operating risk!
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
TD(n) > 2.2
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
Cable with high operating risk!
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
TD(n+1)-TD(n) > 0.6
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
Cable with operating risk!
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
TD(n) > 1.2
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
Cable with operating risk!
</p>
</td>
</tr>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
No criterion matches
</p>
</td>
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Arial; font-size:10pt; font-style:normal;=
text-decoration:none; color:#000000">
Cable can be returned to service
</p>
</td>
</tr>
</table>
<p style=3d"text-align:center;
font-family:Arial; font-size:16pt; font-style:normal;font-weight:bolder;
text-decoration:none; color:#000000">Protocol of actual Measurement</p><p style=3d"text-align:center;
font-family:Arial; font-size:16pt; font-style:normal;font-weight:bolder;
text-decoration:none; color:#000000">Details</p><table align=3dcenter>
<tr >
<td style=3d"text-align:left; vertical-align:top">
<p style=3d"text-align:left;font-family:Courier New; font-size:10pt; font-style:normal;=
font-weight:bolder; text-decoration:none; color:#000000">
# t U&nbs=
p; I we ta <br>&nb=
sp; &=
nbsp; kV mA&=
nbsp; E-3 &n=
bsp; <br>--------------------------------------------=
-----------<br>1 13:02:57 5.8 &=
nbsp; 0.14 0=
.39 <br>2 13:03:07=
5.8 0.14 &nb=
sp; 0.39 <br=
>3 13:03:17 5.8 &nb=
sp; 0.14 0.39  =
; <br>4 13:03:27 5.=
8 0.14  =
; 0.39 <br>5 =
13:03:37 5.8  =
;0.14 0.39 &=
nbsp; <br>6 13:03:47 5.8 &=
nbsp; 0.14 0=
.39 <br>7 13:03:57=
5.8 0.14 &nb=
sp; 0.39 <br=
>8 13:04:08 5.8 &nb=
sp; 0.14 0.39  =
; <br><br>Phase .......................&nb=
sp;: L1<br>Datum/Zeit .................. : 24-01-2=
018 13:04:08<br>Stufe ....................... : 1<=
br>tan-delta-Mittelwert ........ : 0.390 E-3<br>St=
andardabweichung .......... : 0.002 E-3<br>Anzahl&=
nbsp;der Messungen ........ : 8<br>Last .....=
................... : 38.5 nF<br>Pr=fcfobjekt VSE-=
Strom ........ : 32 =b5A<br>Generator VSE-Str=
om ......... : 2 =b5A<br>
</p>
</td>
</tr>
</table>
<p style=3d"page-break-after:always"> </p>
<hr noshade>
<!-- Start Inhalt -->
</body>
</html>