January 26, 2011
How to remove line 2 in a txt-file and add a last line so it always is 25 lines including the header (first line)?
$txt = Get-Content C:\script\Powershell\hourly_temp.txt | select -First 1 -Last 23 $txt = $txt + ($hour + "," + $k1 + "," + $k2 + "," + $ups) $txt | Out-File C:\script\Powershell\hourly_temp.txt -force -encoding ASCII
Subscribe to:
Post Comments (Atom)
Blog Archive
Tags
Links
About Me
- Catherina
- I took the PowerShell Master Class for Thomas Lee in Stockholm in march 2010.
0 kommentarer:
Post a Comment