Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [string] $FileDirectory = "C:tempMove by headerinput";
- [string] $OutputPathHeat = "C:tempMove by headerHeatMeter";
- [string] $OutputPathWater = "C:tempMove by headerWaterMeter";
- [string] $OutputPathOther = "C:tempMove by headerOther";
- foreach ($FilePath in Get-ChildItem $FileDirectory | Select-Object -
- ExpandProperty
- FullName)
- {
- [string] $Header = Get-Content $FilePath -First 1
- if ($Header -match '#serial-number;device-identification;created;value-
- data-
- count;act-duration,second(s),inst-value,0,0,0;avg-
- duration,second(s),inst-value,0,0,0;energy,Wh,inst-
- value,0,0,0;volume,m3,inst-value,0,0,0.*') {
- move-Item $FilePath $OutputPathHeat
- }
- elseif ($Header -match '#serial-number;device-
- identification;created;value-data-
- count;fabrication-no,,inst-
- value,0,0,0;datetime,,inst-
- value,0,0,0;volume,m3,inst-value,0,0,0.*') {
- move-Item $FilePath $OutputPathWater
- }
- else {
- move-Item $FilePath $OutputPathOther
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement