Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 67 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #!/bin/bash
  2.  
  3. replacementsC11=(
  4.         's/Board Temperature[~a-zA-Z0-9]*,/Board Temperature~D12STC00132,/'
  5.         's/HRV Board Thermistor Left[~a-zA-Z0-9]*,/HRV Board Thermistor Left~D12STC00133,/'
  6.         's/HRV Board Thermistor Right[~a-zA-Z0-9]*,/HRV Board Thermistor Right~D12STC00134,/'
  7.         's/Exterior Intake or Exhaust Thermistor[~a-zA-Z0-9]*,Exterior Intake or Exhaust Thermistor[~a-zA-Z0-9]*,/Exterior Intake or Exhaust Thermistor~D12STC00135,Exterior Intake or Exhaust Thermistor~D12STC00136,/'
  8.         's/HRV Building Exhaust Thermistor[~a-zA-Z0-9]*,/HRV Building Exhaust Thermistor~D12STC00137,/'
  9.         's/HRV Building Supply Thermistor[~a-zA-Z0-9]*/HRV Building Supply Thermistor~D12STC00137/'
  10. )
  11. replacementsC12=(
  12.         's/Total Power[~a-zA-Z0-9]*/Total Power~D12SPWH00028/'
  13. )
  14. replacementsC13=(
  15.         's/Board Temperature[~a-zA-Z0-9]*/Board Temperature~D12STC00139/'
  16. )
  17. replacementsC21=(
  18.         's/Total Power[~a-zA-Z0-9]*/Total Power~D12SPWH00029/'
  19. )
  20. replacementsC22=(
  21.         's/Board Temperature[~a-zA-Z0-9]*/Board Temperature~D12STC00140/'
  22. )
  23. replacementsC31=(
  24.         's/Total Power[~a-zA-Z0-9]*/Total Power~D12SPWH00030/'
  25. )
  26. replacementsC32=(
  27.         's/Board Temperature[~a-zA-Z0-9]*/Board Temperature~D12STC00141/'
  28. )
  29.  
  30. declare -A allReplacements
  31. allReplacements['COM1-1*.csv']=replacementsC11
  32. allReplacements['COM1-2*.csv']=replacementsC12
  33. allReplacements['COM1-3*.csv']=replacementsC13
  34. ## etc.
  35.  
  36.  
  37. for glob in "${!allReplacements[@]}"; do
  38.     replacementsVname=${allReplacements[$pattern]}
  39.     replacements=$replacementsVname[@]
  40.     for file in $glob ; do
  41.         for replacement in "${!replacements}" ; do
  42.             sed -i "$replacement" "$file"
  43.         done
  44.     done
  45. done
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top