Guest User

Untitled

a guest
Jan 7th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #Variables
  2. $replace='2.55'
  3. $filepath= 'C:folderpathbond.out'
  4. #go straight to the line I want to change something in
  5. $data = Get-Content $filepath | select -skip 38 -first 1
  6. #split it all, find the other variable and overwrite it
  7. $split=$data.split("{|}")
  8. $split[3]=$replace
  9. #put it all back again
  10. $join = $split -join "|"
  11. write-output $join
  12.  
  13. #Variables
  14. $replace='2.55'
  15. $filepath= 'C:folderpathbond.out'
  16. #find the variable
  17. $data = Get-Content $filepath | select-string $bond
  18. #split it all, find the other variable and overwrite it
  19. $split=$data.split("{|}")
  20. $split[3]=$replace
  21. #put it all back again
  22. $join = $split -join "|"
  23. write-output $join
Add Comment
Please, Sign In to add comment