Skip to content

Commit e74496f

Browse files
committed
Update Extract-HTMLTable.ps1
1 parent 42ebde8 commit e74496f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Extract-HTMLTable.ps1

+7-2
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@ function Extract-HTMLTable {
4141
}
4242

4343
## Go through all of the rows in the table
44+
$tableNumber = 0
4445
foreach ($table in $tables) {
4546
$titles = @()
4647
$rows = @($table.Rows)
4748

49+
$tableNumber++
50+
4851
foreach ($row in $rows) {
4952
$cells = @($row.Cells)
5053

@@ -62,11 +65,13 @@ function Extract-HTMLTable {
6265
## Now go through the cells in the the row. For each, try to find the
6366
## title that represents that column and create a hashtable mapping those
6467
## titles to content
65-
$resultObject = [Ordered] @{}
68+
$resultObject = [Ordered] @{
69+
"TableNumber" = $tableNumber
70+
}
71+
6672
for ($counter = 0; $counter -lt $cells.Count; $counter++) {
6773
$title = $titles[$counter]
6874
if (-not $title) { continue }
69-
7075
$resultObject[$title] = ('' + $cells[$counter].InnerText).Trim()
7176
}
7277

0 commit comments

Comments
 (0)