Skip to content

Instantly share code, notes, and snippets.

@josheinstein
Created July 24, 2012 19:14
Show Gist options
  • Select an option

  • Save josheinstein/3171994 to your computer and use it in GitHub Desktop.

Select an option

Save josheinstein/3171994 to your computer and use it in GitHub Desktop.
Expand-Numbers
Set-Location ~\Dropbox\Work\Journal\201207
Import-CSV numbers.csv -Header From,To | %{
if ($_.From -match '^\d+$') {
[Int64]$From = $_.From
[Int64]$To = $(if ($_.To) { $_.To } else { $From })
[Int64]$i = $From
while ($i -le $To) {
Write-Output $i
$i += 1
}
}
} | Sort | sc numbers.txt
@josheinstein
Copy link
Author

something quick I threw together for Jan that takes a CSV file containing DID ranges and prints out the sorted list of all numbers in the range.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment