Tuesday, February 26, 2008

2008 Scripting Games!! Beg. Event 6

Event 6 I got a little lazy and just did a few copy paste commands.

   1:  gc "C:\scripts\coffee.txt" | ? { $_.Contains("Espresso")} | % { $Espresso+=[int]$($_.substring($_.length-2,2)) };"Espresso: $espresso"
   2:  gc "C:\scripts\coffee.txt" | ? { $_.Contains("Latte")} | % { $Latte+=[int]$($_.substring($_.length-2,2)) };"Latte: $Latte"
   3:  gc "C:\scripts\coffee.txt" | ? { $_.Contains("Cappuccino")} | % { $Cappuccino+=[int]$($_.substring($_.length-2,2)) };"Cappuccino: $Cappuccino"

No comments: