Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. [string] $FileDirectory = "C:tempMove by headerinput";
  2. [string] $OutputPathHeat = "C:tempMove by headerHeatMeter";
  3. [string] $OutputPathWater = "C:tempMove by headerWaterMeter";
  4. [string] $OutputPathOther = "C:tempMove by headerOther";
  5.  
  6. foreach ($FilePath in Get-ChildItem $FileDirectory | Select-Object -
  7. ExpandProperty
  8. FullName)
  9. {
  10. [string] $Header = Get-Content $FilePath -First 1
  11.  
  12. if ($Header -match '#serial-number;device-identification;created;value-
  13. data-
  14. count;act-duration,second(s),inst-value,0,0,0;avg-
  15. duration,second(s),inst-value,0,0,0;energy,Wh,inst-
  16. value,0,0,0;volume,m3,inst-value,0,0,0.*') {
  17. move-Item $FilePath $OutputPathHeat
  18. }
  19. elseif ($Header -match '#serial-number;device-
  20. identification;created;value-data-
  21. count;fabrication-no,,inst-
  22. value,0,0,0;datetime,,inst-
  23. value,0,0,0;volume,m3,inst-value,0,0,0.*') {
  24. move-Item $FilePath $OutputPathWater
  25. }
  26. else {
  27. move-Item $FilePath $OutputPathOther
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement