diff --git a/Examples/Nasa/FireBalls.ps1 b/Examples/Nasa/FireBalls.ps1 index d9a0972..8cd723e 100644 --- a/Examples/Nasa/FireBalls.ps1 +++ b/Examples/Nasa/FireBalls.ps1 @@ -10,4 +10,4 @@ $header = echo ` 'Total Radiated Energy (J)' ` 'Calculated Total Impact Energy (kt)' -Import-Html http://neo.jpl.nasa.gov/fireballs/ 5 -Header $header +Import-Html http://neo.jpl.nasa.gov/fireballs/ 5 -Header $header -FirstDataRow 1 \ No newline at end of file diff --git a/Get-HtmlTable.ps1 b/Get-HtmlTable.ps1 index defbe11..51ecd3c 100644 --- a/Get-HtmlTable.ps1 +++ b/Get-HtmlTable.ps1 @@ -3,7 +3,8 @@ function Get-HtmlTable { [Parameter(Mandatory=$true)] $url, $tableIndex=0, - $Header + $Header, + [int]$FirstDataRow=0 ) $r = Invoke-WebRequest $url @@ -11,7 +12,7 @@ function Get-HtmlTable { $propertyNames=$Header $totalRows=@($table.rows).count - for ($idx = 1; $idx -lt $totalRows; $idx++) { + for ($idx = $FirstDataRow; $idx -lt $totalRows; $idx++) { $row = $table.rows[$idx] $cells = @($row.cells) diff --git a/Import-Html.ps1 b/Import-Html.ps1 index 32b316e..62b7e47 100644 --- a/Import-Html.ps1 +++ b/Import-Html.ps1 @@ -4,7 +4,8 @@ function Import-Html { param( $url, $index, - $Header + $Header, + [int]$FirstDataRow=0 ) $xlFile = [System.IO.Path]::GetTempFileName() -replace "tmp","xlsx" @@ -12,7 +13,7 @@ function Import-Html { Write-Verbose "Exporting to Excel file $($xlFile)" - $data = Get-HtmlTable -url $url -tableIndex $index -Header $Header + $data = Get-HtmlTable -url $url -tableIndex $index -Header $Header -FirstDataRow $FirstDataRow $data | Export-Excel $xlFile -Show -AutoSize } \ No newline at end of file