Skip to content

Instantly share code, notes, and snippets.

@mikekirby
Last active September 23, 2017 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mikekirby/e2b2dc5c6c0acea8a8759aa7037dc84e to your computer and use it in GitHub Desktop.
Save mikekirby/e2b2dc5c6c0acea8a8759aa7037dc84e to your computer and use it in GitHub Desktop.
updating attribute names, fixing up HTML
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Excel.Sheet" />
<meta name="isi:reportVersion" content="1.0" />
<meta name="isi:reportId" content="93aef679-8e9d-4fb6-865c-4ad11ae8dd75" />
<meta name="isi:reportType" content="LogReport" />
<meta name="isi:reportCreated" content="2016-09-20T16:08:33Z" />
<meta name="isi:wsl" content="version=1.0;H4sIAAAAAAAAA3VSzW7TQBAepyYJIZXSlooIkLAEqlIJS0nz04QjlBs/FfQFnHhdLHAdrTecOPQBeAAegyMHkBBnjjwCB4QQrxC+Ga9dI8FaszOe3W/222+nSzy2yaMmtalBHbpKXbqJjIwNt0b00SH6Cv8C/hjmYuESrI34A/w57IjyfHe9XhO1sL6HekTxjYbYLcTPVzoKFsp7+Eq9Dkycnnm9yOx7vdFkfDiZ7dOJxTr4qtjriE9UslQ6MCutvN6X9w8qMHprcTXa+gt3DfGxVlkmoGUWV0CfBbOJ++4K5tPvhthtxPcDnSbK6HjhXcCTeaCBHw9mU8Z3oFIbcx16NXF2R+TaLLkX9f7DvSgjmnWg7S9o+c3JtcYv9ayeP4VnTe7jUjFacjK/WCt/pnM+62KdZM3F3KzUcqxfoib7K8wtTpT3NIoyZaAe0TO1TLXBvVNQNrHKkLuH/e/g31j8BuNgd+3/d+FINY4vwx6lZ6exWYXK8mhYHkzBlRz2oAHsFrvq2plV5BqLvEW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TEuMy0wLjQtMi40LTEuMy0zLjNjLTAuOS0wLjktMi0xLjQtMy4zLTEuNEMxMjguNCw4OC4xLDEyNy4zLDg4LjUsMTI2LjQsODkuNCBNMTI5LjYsODkuN2MwLjcsMCwxLjMsMC4xLDEuNiwwLjINCgkJYzAuNiwwLjMsMC45LDAuOCwwLjksMS41YzAsMC41LTAuMiwwLjktMC42LDEuMmMtMC4yLDAuMS0wLjUsMC4yLTAuOSwwLjNjMC41LDAuMSwwLjgsMC4zLDEsMC42YzAuMiwwLjMsMC4zLDAuNiwwLjMsMC45djAuNA0KCQljMCwwLjEsMCwwLjMsMCwwLjRjMCwwLjIsMCwwLjMsMC4xLDAuM2wwLDAuMWgtMWMwLDAsMCwwLDAtMC4xYzAsMCwwLDAsMC0wLjFsMC0wLjJ2LTAuNWMwLTAuNy0wLjItMS4xLTAuNS0xLjMNCgkJYy0wLjItMC4xLTAuNi0wLjItMS4yLTAuMmgtMC44djIuM2gtMXYtNS45SDEyOS42eiBNMTMwLjcsOTAuNmMtMC4zLTAuMS0wLjctMC4yLTEuMy0wLjJoLTAuOXYyLjFoMC45YzAuNCwwLDAuOCwwLDEtMC4xDQoJCWMwLjQtMC4yLDAuNi0wLjUsMC42LTAuOUMxMzEuMSw5MS4xLDEzMSw5MC44LDEzMC43LDkwLjYiLz4NCjwvZz4NCjwvc3ZnPg==");
background-size: 160px;
background-repeat: no-repeat;
background-position: 0px;
margin: 5px 15px;
height: 50px;
width: 180px;
float: left;
}
body {
font-family: "Roboto", Arial, Helvetica, Geneva, sans-serif;
margin: 0px;
}
#header {
height: 10px;
background: #002378;
margin-bottom: 10px;
}
#devLink {
font-size: 9px;
float: right;
margin: 15px;
}
#header {
height: 5px;
background: #002378;
margin-bottom: 10px;
clear: both;
}
button {
font-weight: bold;
font-size: 14px;
color: #00238c;
padding: 5px 10px 5px 30px;
background-color: #ffb937;
border: 2px solid #00238c;
background-image: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEi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MywwLDIyLjctOC44LDIyLjctMTkuN0MxMDAsMzcuNyw5NC41LDI5LjYsODYsMjd6Ii8+DQoJCTxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iNTUuMyw0OS43IDQxLjYsNDkuNyA0MS42LDczLjEgMjgsNzMuMSA0OC41LDEwMCA2OSw3My4xIDU1LjMsNzMuMSAJCSIvPg0KCTwvZz4NCjwvZz4NCjwvc3ZnPg==");
background-repeat: no-repeat;
background-size: 18px;
background-position: 5px;
cursor: pointer;
margin: 15px 15px 13px 15px;
}
table {
margin-left: 15px;
}
td {
border:none;
white-space:nowrap;
font-size: 13px;
height: 14px;
padding-right: 15px;
}
table tr.sectionHeader td {
font-weight:bold;
}
table tr.dataHeader td {
font-weight:bold;
}
.date {
mso-number-format:"m\/d\/yy\\ h\:mm\:ss\.000";
}
.data, .date {
text-align: left;
white-space: nowrap;
}
dl {
overflow: hidden;
}
dt {
float: left;
}
dd {
float: left;
}
#processing {
margin: 20px 0px;
float: left;
width: 180px;
}
.spinner {
position: relative;
left: 0px;
}
@keyframes spinner {
to {transform: rotate(360deg);}
}
.spinner:before {
content: '';
box-sizing: border-box;
position: absolute;
width: 20px;
height: 20px;
border-radius: 50%;
border-top: 2px solid #00278c;
border-right: 2px solid transparent;
animation: spinner 1.2s linear infinite;
}
@keyframes spinner2 {
to {transform: rotate(360deg);}
}
.spinner2:before {
content: '';
box-sizing: border-box;
position: absolute;
width: 20px;
height: 20px;
border-radius: 50%;
border-bottom: 2px solid #00278c;
border-left: 2px solid transparent;
animation: spinner 1.2s linear infinite;
}
-->
</style>
<script type="text/javascript">
<!--//<![CDATA[
window.addEventListener("load", function() {
var button = document.createElement("button");
button.appendChild(document.createTextNode("Export CSV"));
button.addEventListener("click", function() {
var json = toJSON();
var csvData = ToCSV();
// console.log(csvData);
var blob = new Blob([csvData], {type: 'text/csv'});
var a = window.document.createElement('a');
a.href = window.URL.createObjectURL(blob);
a.download = 'test.csv';
// Append anchor to body.
document.body.appendChild(a);
a.click();
// Remove anchor from body
document.body.removeChild(a);
});
var logo = document.createElement("div");
logo.id ="logo";
var devLink = document.createElement("a");
devLink.href ="http://in-situ.com/developer";
devLink.target = "_blank";
devLink.appendChild(document.createTextNode("How can I auto-import these files?"))
var devLinkDiv = document.createElement("div");
devLinkDiv.id ="devLink";
devLinkDiv.appendChild(devLink);
var styleHeader = document.createElement("div");
styleHeader.id = "header";
var spinner1Div = document.createElement("div");
spinner1Div.class = "spinner";
var spinner2Div = document.createElement("div");
spinner2Div.class = "spinner2";
var processingDiv = document.createElement("div");
processingDiv.id = "processing";
processingDiv.appendChild(spinner1Div);
processingDiv.appendChild(spinner2Div);
var buttonDiv = document.createElement("div");
buttonDiv.id = "button";
buttonDiv.appendChild(button);
buttonDiv.appendChild(processingDiv);
var body = document.body;
body.insertBefore(styleHeader, body.childNodes[0]);
body.insertBefore(devLinkDiv, body.childNodes[0]);
body.insertBefore(buttonDiv, body.childNodes[0]);
body.insertBefore(logo, body.childNodes[0]);
});
function ToCSV() {
var newLine = "\r\n";
var quote ="\"";
var csv = "";
var delimiter = ",";
var propertyDelimiter = " = ";
var logNoteDelimiter = " ";
var dataTable = document.getElementById("isi-data-table");
for (let row of dataTable.rows) {
for (let cell of row.cells) {
for (var index=0; index<cell.attributes.length; index++) {
var attribute = cell.attributes[index];
switch (attribute.name) {
case "isi-property-section":
if (row.previousElementSibling != null)
csv += newLine;
var section = getSection(cell);
csv += sanitize(section.text) + newLine;
break;
case "isi-property":
var property = getProperty(cell);
csv += quote + sanitize(property.text) + propertyDelimiter + property.value + quote + newLine;
break;
case "isi-data-column-header":
csv += cell.previousElementSibling == null ? newLine + newLine : delimiter;
var columnHeader = getDataColumnHeader(cell);
csv += quote + sanitize(columnHeader.text) + quote;
if (cell.nextElementSibling == null)
csv += newLine;
break;
case "isi-data-column":
if (cell.previousElementSibling != null)
csv += delimiter;
var dataItem = getDataItem(cell);
csv += quote + sanitize(dataItem.value) + quote;
if (cell.nextElementSibling == null)
csv += newLine;
break;
case "isi-log-note-section":
csv += newLine;
var section = getSection(cell);
csv += sanitize(section.text) + newLine;
break;
case "isi-log-note":
var logNote = getLogNote(cell);
csv += quote + sanitize(logNote.timestamp) + logNoteDelimiter + logNote.text + quote + newLine;
break;
}
}
}
}
return csv;
}
function sanitize(strValue) {
return strValue
.replace(/"/g, "\"\"")
.replace(/\n/g, "")
.replace(/\r/g, "")
.replace(/\t/g, "")
.replace(/=/g, " ")
.trim();
}
function getSection(node) {
var section = new Object();
section.text = node.innerText;
return section;
}
function getDataItem(node) {
var dataItem = new Object();
dataItem.value = node.innerText;
for (var index=0; index<node.attributes.length; index++) {
var attribute = node.attributes[index];
switch (attribute.name) {
case "isi-timestamp":
dataItem.timestamp = attribute.value;
break;
}
}
return dataItem;
}
function getDataColumnHeader(node) {
var columnHeader = new Object();
columnHeader.text = node.innerText;
for (var index=0; index<node.attributes.length; index++) {
var attribute = node.attributes[index];
switch (attribute.name) {
case "isi-data-column":
columnHeader.type = attribute.value;
break;
case "isi-parameter-type":
columnHeader.parameterType = attribute.value;
break;
case "isi-unit-type":
columnHeader.unitType = attribute.value;
break;
case "isi-serial-number":
columnHeader.serialNumber = attribute.value;
break;
}
}
return columnHeader;
}
function getLogNote(node) {
var note = new Object();
for (let child of node.children) {
for (var index=0; index<child.attributes.length; index++) {
var attribute = child.attributes[index];
switch (attribute.name) {
case "isi-timestamp":
note.datetime = attribute.value;
note.timestamp = child.innerText;
break;
case "isi-log-note-type":
note.noteType = attribute.value;
note.text = child.innerText;
break;
}
}
}
return note;
}
function getProperty(node) {
var property = new Object();
for (let child of node.children) {
for (var index=0; index<child.attributes.length; index++) {
var attribute = child.attributes[index];
switch (attribute.name) {
case "isi-property-header":
property.text = child.innerText;
break;
case "isi-property-value":
property.value = child.innerText;
break;
}
}
}
return property;
}
function toJSON() {
var dataTable = document.getElementById("isi-data-table");
var json = new Object();
json.propertyGroups = [];
json.dataTable = new Object;
json.dataTable.headers = [];
json.dataTable.rows = [];
json.logNotes = [];
var lastPropertyGroup;
for (let row of dataTable.rows) {
for (let cell of row.cells) {
for (var index=0; index<cell.attributes.length; index++) {
var attribute = cell.attributes[index];
switch (attribute.name) {
case "isi-property-section":
var section = getSection(cell);
json.propertyGroups[attribute.value] = lastPropertyGroup = new Object();
lastPropertyGroup.text = section.text;
lastPropertyGroup.properties = [];
break;
case "isi-property":
var property = getProperty(cell);
lastPropertyGroup.properties[attribute.value] = property;
break;
case "isi-data-column-header":
var columnHeader = getDataColumnHeader(cell);
json.dataTable.headers.push(columnHeader);
break;
case "isi-data-column":
if (cell.previousElementSibling == null)
json.dataTable.rows.push([]);
var dataItem = getDataItem(cell);
json.dataTable.rows[json.dataTable.rows.length-1].push(dataItem);
break;
case "isi-log-note":
var logNote = getLogNote(cell);
json.logNotes.push(logNote);
break;
}
}
}
}
return json;
}
//]]>-->
</script>
</head>
<body>
<table isi-data-table="1" id="isi-data-table">
<tr class="sectionHeader">
<td isi-property-section="LocationProperties">Location Properties</td>
</tr>
<tr>
<td isi-property="Name">
<span isi-property-header>Location Name</span> = <span isi-property-value>Well 123</span>
</td>
</tr>
<tr>
<td isi-property="GUID">
<span isi-property-header>Location GUID</span> = <span isi-property-value>93aef679-8e9d-4fb6-865c-4ad11ae8dd75</span>
</td>
</tr>
<tr>
<td isi-property="Latitude">
<span isi-property-header>Latitude</span> = <span isi-property-value>0</span>
</td>
</tr>
<tr>
<td isi-property="Longitude">
<span isi-property-header>Longitude</span> = <span isi-property-value>0</span>
</td>
</tr>
<tr>
<td />
</tr>
<tr class="sectionHeader">
<td isi-property-section="ReportProperties">Report Properties</td>
</tr>
<tr>
<td isi-property="StartTime">
<span isi-property-header>Start Time</span> = <span isi-property-value isi-timestamp="123456">2017-08-31 15:04:16.629</span>
</td>
</tr>
<tr>
<td isi-property="Duration">
<span isi-property-header>Duration</span> = <span isi-property-value>00:04:18</span>
</td>
</tr>
<tr>
<td isi-property="Readings">
<span isi-property-header>Readings</span> = <span isi-property-value>6</span>
</td>
</tr>
<tr>
<td isi-property="TimeOffset">
<span isi-property-header>Time Offset</span> = <span isi-property-value>-06:00:00</span>
</td>
</tr>
<tr>
<td />
</tr>
<tr class="sectionHeader">
<td isi-property-section="InstrumentProperties">Instrument Properties</td>
</tr>
<tr>
<td isi-property="Model">
<span isi-property-header>Device Model</span> = <span isi-property-value isi-device-type="8">Level TROLL 700</span>
</td>
</tr>
<tr>
<td isi-property="SerialNumber">
<span isi-property-header>Device SN</span> = <span isi-property-value>465769</span>
</td>
</tr>
<tr>
<td isi-property="FirmwareVersion">
<span isi-property-header>Device Firmware</span> = <span isi-property-value>3.03</span>
</td>
</tr>
<tr>
<td />
</tr>
<tr class="sectionHeader">
<td isi-property-section="LogProperties">Log Properties</td>
</tr>
<tr>
<td isi-property="LogType">
<span isi-property-header>Log Type</span> = <span isi-property-value isi-log-type="3">Linear</span>
</td>
</tr>
<tr>
<td isi-property="Name">
<span isi-property-header>Log Name</span> = <span isi-property-value>CR25 Winter 2016</span>
</td>
</tr>
<tr>
<td isi-property="Guid">
<span isi-property-header>Log Guid</span> = <span isi-property-value>93aef679-8e9d-4fb6-865c-4ad11ae8dd75</span>
</td>
</tr>
<tr>
<td isi-property="FileNumber">
<span isi-property-header>Log File Number</span> = <span isi-property-value>2</span>
</td>
</tr>
<tr>
<td isi-property="Interval">
<span isi-property-header>Interval</span> = <span isi-property-value>00:01:00</span>
</td>
</tr>
<tr>
<td isi-property="AveragingInterval">
<span isi-property-header>Averaging Interval</span> = <span isi-property-value>00:01:00</span>
</td>
</tr>
<tr>
<td isi-property="AveragingSampleSize">
<span isi-property-header>Averaging Sample Size</span> = <span isi-property-value>1</span>
</td>
</tr>
<tr>
<td isi-property="EventSamplingInterval">
<span isi-property-header>Event Sampling Interval</span> = <span isi-property-value>00:01:00</span>
</td>
</tr>
<tr>
<td isi-property="EventDefaultInterval">
<span isi-property-header>Event Default Interval</span> = <span isi-property-value>00:01:00</span>
</td>
</tr>
<tr>
<td isi-property="EventHighThreshold">
<span isi-property-header>Event High Threshold</span> = <span isi-property-value>9</span>
</td>
</tr>
<tr>
<td isi-property="EventLowThreshold">
<span isi-property-header>Event Low Threshold</span> = <span isi-property-value>1</span>
</td>
</tr>
<tr>
<td isi-property="EventChangeThreshold">
<span isi-property-header>Event Change Threshold</span> = <span isi-property-value>1</span>
</td>
</tr>
<tr>
<td isi-property="EventChangeSinceLastLoggedThreshold">
<span isi-property-header>Event Change Since Last Logged Threshold</span> = <span isi-property-value>?</span>
</td>
</tr>
<tr>
<td isi-property="LogWrapping">
<span isi-property-header>Log Wrapping</span> = <span isi-property-value isi-enabled="true">Enabled</span>
</td>
</tr>
<tr>
<td isi-property="LogStepCount">
<span isi-property-header>Log Steps</span> = <span isi-property-value>2</span>
</td>
</tr>
<tr>
<td isi-property="LogStepDuration">
<span isi-property-header>Log Step 1 Duration</span> = <span isi-property-value>00:01:00</span>
</td>
</tr>
<tr>
<td isi-property="LogStepInterval">
<span isi-property-header>Log Step 1 Interval</span> = <span isi-property-value>00:02:00</span>
</td>
</tr>
<tr>
<td isi-property="LogStepDuration">
<span isi-property-header>Log Step 2 Duration</span> = <span isi-property-value>00:03:00</span>
</td>
</tr>
<tr>
<td isi-property="LogStepInterval">
<span isi-property-header>Log Step 2 Interval</span> = <span isi-property-value>00:04:00</span>
</td>
</tr>
<tr>
<td />
</tr>
<tr class="sectionHeader">
<td isi-property-section="TestProperties">Test Properties</td>
</tr>
<tr>
<td isi-property="TestType">
<span isi-property-header>Test Type</span> = <span isi-property-value isi-test-type="LowFlow">Low Flow</span>
</td>
</tr>
<tr>
<td isi-property="StartTime">
<span isi-property-header>Test Date Time</span> = <span isi-property-value>2017-08-31 15:04:16.629</span>
</td>
</tr>
<tr>
<td isi-property="TimeOffset">
<span isi-property-header>Time Offset</span> = <span isi-property-value>-07:00:00</span>
</td>
</tr>
<tr>
<td isi-property="ProjectName">
<span isi-property-header>Project Name</span> = <span isi-property-value>Trial #2</span>
</td>
</tr>
<tr>
<td isi-property="OperatorName">
<span isi-property-header>Operator Name</span> = <span isi-property-value>Bob</span>
</td>
</tr>
<tr>
<td isi-property="FlowCellVolume">
<span isi-property-header>Flow Cell Volume</span> = <span isi-property-value isi-unit-type="1">1 cc</span>
</td>
</tr>
<tr>
<td isi-property="InitialDepthToWater">
<span isi-property-header>Initial Depth To Water</span> = <span isi-property-value isi-unit-type="1">1 ft</span>
</td>
</tr>
<tr>
<td isi-property="FinalDrawDown">
<span isi-property-header>Final Draw Down</span> = <span isi-property-value isi-unit-type="1">1 ft</span>
</td>
</tr>
<tr>
<td isi-property="TotalSystemVolume">
<span isi-property-header>Total System Volume</span> = <span isi-property-value isi-unit-type="1">1 cf</span>
</td>
</tr>
<tr>
<td isi-property="TotalPumpedVolume">
<span isi-property-header>Total Pumped Volume</span> = <span isi-property-value isi-unit-type="1">1 cf</span>
</td>
</tr>
<tr>
<td />
</tr>
<tr class="sectionHeader">
<td isi-property-section="WellProperties">Well Properties</td>
</tr>
<tr>
<td isi-property="CasingType">
<span isi-property-header>Casing Type</span> = <span isi-property-value>Plastic</span>
</td>
</tr>
<tr>
<td isi-property="Diameter">
<span isi-property-header>Diameter</span> = <span isi-property-value isi-unit-type="1">2 in</span>
</td>
</tr>
<tr>
<td isi-property="TotalDepth">
<span isi-property-header>Total Depth</span> = <span isi-property-value isi-unit-type="1">2 in</span>
</td>
</tr>
<tr>
<td isi-property="DepthToScreen">
<span isi-property-header>Depth To Screen</span> = <span isi-property-value isi-unit-type="1">2 in</span>
</td>
</tr>
<tr>
<td isi-property="ScreenLength">
<span isi-property-header>Screen Length</span> = <span isi-property-value isi-unit-type="1">2 in</span>
</td>
</tr>
<tr>
<td />
</tr>
<tr class="sectionHeader">
<td isi-property-section="PumpProperties">Pump Properties</td>
</tr>
<tr>
<td isi-property="Model">
<span isi-property-header>Model</span> = <span isi-property-value>HP3000</span>
</td>
</tr>
<tr>
<td isi-property="FlowRate">
<span isi-property-header>Rate</span> = <span isi-property-value isi-unit-type="1">2 in/s</span>
</td>
</tr>
<tr>
<td isi-property="Volume">
<span isi-property-header>Volume</span> = <span isi-property-value isi-unit-type="1">2 cc</span>
</td>
</tr>
<tr>
<td isi-property="IntakeFromTopOfCasing">
<span isi-property-header>Intake from TOC</span> = <span isi-property-value isi-unit-type="1">2 cc</span>
</td>
</tr>
<tr>
<td isi-property="FinalPumpingRate">
<span isi-property-header>Final Pumping Rate</span> = <span isi-property-value isi-unit-type="1">2 cc/s</span>
</td>
</tr>
<tr>
<td />
</tr>
<tr class="sectionHeader">
<td isi-property-section="TubingProperties">Tubing Properties</td>
</tr>
<tr>
<td isi-property="TubingType">
<span isi-property-header>Type</span> = <span isi-property-value>Plastic</span>
</td>
</tr>
<tr>
<td isi-property="Diameter">
<span isi-property-header>Diameter</span> = <span isi-property-value isi-unit-type="1">2 in</span>
</td>
</tr>
<tr>
<td isi-property="Length">
<span isi-property-header>Length</span> = <span isi-property-value isi-unit-type="1">2 ft</span>
</td>
</tr>
<tr>
<td />
</tr>
<tr>
<td />
</tr>
<tr class="dataHeader">
<td isi-data-column-header="datetime">Date Time</td>
<td isi-data-column-header="parameter"
isi-device-id="465769"
isi-sensor-id="465769"
isi-sensor-type="2"
isi-parameter-type="2"
isi-unit-type="2">Pressure (psi) (465769)</td>
<td isi-data-column-header="parameter"
isi-device-id="465769"
isi-sensor-id="465769"
isi-sensor-type="2"
isi-parameter-type="2"
isi-unit-type="2">Temperature (°C) (465769)</td>
<td isi-data-column-header="parameter"
isi-device-id="465769"
isi-sensor-id="465769"
isi-sensor-type="2"
isi-parameter-type="2"
isi-unit-type="2">Depth To Water (cm) (465769)</td>
<td isi-data-column-header="marked"
isi-marked>Marked</td>
</tr>
<tr class="data">
<td isi-data-column isi-timestamp="123456" class="date">8/31/17 15:04:17.000</td>
<td isi-data-column>12.31928</td>
<td isi-data-column>23.763</td>
<td isi-data-column>9.842544</td>
<td isi-data-column/>
</tr>
<tr class="data">
<td isi-data-column isi-timestamp="123456" class="date">8/31/17 15:05:16.630</td>
<td isi-data-column>12.31463</td>
<td isi-data-column>23.77313</td>
<td isi-data-column>10.17007</td>
<td isi-data-column/>
</tr>
<tr class="data">
<td isi-data-column isi-timestamp="123456" class="date">8/31/17 15:06:16.630</td>
<td isi-data-column>12.31222</td>
<td isi-data-column>23.78256</td>
<td isi-data-column>10.33948</td>
<td isi-data-column/>
</tr>
<tr class="data">
<td isi-data-column isi-timestamp="123456" class="date">8/31/17 15:06:33.859</td>
<td isi-data-column>12.31582</td>
<td isi-data-column>23.78979</td>
<td isi-data-column>9.71341</td>
<td isi-data-column/>
</tr>
<tr class="data">
<td isi-data-column isi-timestamp="123456" isi-marked class="date">8/31/17 15:07:33.859</td>
<td isi-data-column isi-marked>12.31108</td>
<td isi-data-column isi-marked>23.79341</td>
<td isi-data-column isi-marked>10.04752</td>
<td isi-data-column isi-marked>Marked</td>
</tr>
<tr class="data">
<td isi-data-column isi-timestamp="123456" class="date">8/31/17 15:08:33.859</td>
<td isi-data-column>12.31834</td>
<td isi-data-column>23.80064</td>
<td isi-data-column>9.536489</td>
<td isi-data-column/>
</tr>
<tr>
<td />
</tr>
<tr class="sectionHeader">
<td isi-log-note-section>Log Notes</td>
</tr>
<tr>
<td isi-log-note>
<span isi-timestamp="123456">2017-08-31 15:04:16.570</span> <span isi-log-note-type="1">Started</span>
</td>
</tr>
<tr>
<td isi-log-note>
<span isi-timestamp="123457">2017-08-31 15:06:32.415</span> <span isi-log-note-type="4">Device Offline</span>
</td>
</tr>
<tr>
<td isi-log-note>
<span isi-timestamp="123458">2017-08-31 15:06:33.804</span> <span isi-log-note-type="3">Device Online</span>
</td>
</tr>
<tr>
<td isi-log-note>
<span isi-timestamp="123459">2017-08-31 15:08:52.880</span> <span isi-log-note-type="2">Stopped</span>
</td>
</tr>
<tr>
<td />
</tr>
<tr>
<td />
</tr>
<tr class="sectionHeader">
<td isi-data-column-header="datetime">Date Time</td>
<td isi-data-column-header="elapsedTime">Elapsed Time</td>
<td isi-data-column-header="parameter"
isi-device-id="465769"
isi-sensor-id="465769"
isi-sensor-type="2"
isi-parameter-type="2"
isi-unit-type="2">Pressure (psi) (465769)</td>
<td isi-data-column-header="parameter"
isi-device-id="465769"
isi-sensor-id="465769"
isi-sensor-type="2"
isi-parameter-type="2"
isi-unit-type="2">Temperature (°C) (465769)</td>
<td isi-data-column-header="parameter"
isi-parameter-type="2"
isi-unit-type="2">Turbidity (NTU)</td>
</tr>
<tr class="data">
<td isi-data-column isi-timestamp="123456" class="date">8/31/17 15:04:17.000</td>
<td isi-data-column>00:01:00</td>
<td isi-data-column>12.31928</td>
<td isi-data-column>23.763</td>
<td isi-data-column>99.2</td>
</tr>
<tr>
<td />
</tr>
<tr class="sectionHeader">
<td isi-lowflow-sample-section>Samples</td>
</tr>
<tr>
<td isi-lowflow-sample>
<span isi-lowflow-sampleId>Sample-801</span>: <span isi-lowflow-sample-value>Pre Test Sample</span>
</td>
</tr>
<tr>
<td isi-lowflow-sample>
<span isi-lowflow-sampleId>Sample-802</span>: <span isi-lowflow-sample-value>Post Test Sample</span>
</td>
</tr>
<tr>
<td />
</tr>
<tr class="sectionHeader">
<td isi-lowflow-note-section>Notes</td>
</tr>
<tr>
<td isi-lowflow-note>
<span isi-lowflow-note-type="TestNote">Test Note</span>: <span isi-lowflow-sample-value>Ended late, pump failed, replaced with HP5000</span>
</td>
</tr>
<tr>
<td isi-lowflow-note>
<span isi-lowflow-note-type="Weather">Weather Conditions</span>: <span isi-lowflow-sample-value>Cold, Breezy</span>
</td>
</tr>
</table>
</body>
</html>
<!-- 0JuY5T45+5InMNk4bB5Det1ZwSW2tmDM77SorGMXx5s= -->
name: Excel HTML
description: HTML Previewer for Excel consumable HTML and CSV generator
normalize_css: no
wrap: h
panel_js: 0
panel_css: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment