"E1 Sys1 (PTAC) (G.WNW2)" = SYSTEM
TYPE = PTAC
HEAT-SOURCE = HEAT-PUMP
BASEBOARD-SOURCE = NONE
SIZING-RATIO = 1.15
MAX-SUPPLY-T = 90
MIN-SUPPLY-T = 55
FAN-SCHEDULE = "S1 Sys1 (PTAC) Fan Sch"
FAN-CONTROL = TWO-SPEED
SUPPLY-STATIC = 0.5
SUPPLY-EFF = 0.33
COOLING-EIR = 0.329152
HEATING-EIR = 0.34025
..
"E1 WNW Perim Zn (G.WNW2)" = ZONE
TYPE = CONDITIONED
MIN-FLOW-RATIO = 1
FLOW/AREA = 0.5
OA-FLOW/PER = 34.6035
DESIGN-HEAT-T = 72
HEAT-TEMP-SCH = "S1 Sys1 (PTAC) Heat Sch"
DESIGN-COOL-T = 75
COOL-TEMP-SCH = "S1 Sys1 (PTAC) Cool Sch"
SIZING-OPTION = ADJUST-LOADS
SPACE = "Unit 100"
..
I have this text file for the building energy modeling.
The system (E1 Sys1 (PTAC) (G.WNW2)) and zone (E1 WNW Perim Zn (G.WNW2)) are a pair.
I would like to replace the system name and zone name by referring the space name and adding abbreviations (e.g. _sys, _zn) to make those easy to understand.
The space name will be at the bottom of zone part.
Could you please help me to replace the above with the following?
"Unit 100_sys" = SYSTEM
TYPE = PTAC
HEAT-SOURCE = HEAT-PUMP
BASEBOARD-SOURCE = NONE
SIZING-RATIO = 1.15
MAX-SUPPLY-T = 90
MIN-SUPPLY-T = 55
FAN-SCHEDULE = "S1 Sys1 (PTAC) Fan Sch"
FAN-CONTROL = TWO-SPEED
SUPPLY-STATIC = 0.5
SUPPLY-EFF = 0.33
COOLING-EIR = 0.329152
HEATING-EIR = 0.34025
..
"Unit 100_zn" = ZONE
TYPE = CONDITIONED
MIN-FLOW-RATIO = 1
FLOW/AREA = 0.5
OA-FLOW/PER = 34.6035
DESIGN-HEAT-T = 72
HEAT-TEMP-SCH = "S1 Sys1 (PTAC) Heat Sch"
DESIGN-COOL-T = 75
COOL-TEMP-SCH = "S1 Sys1 (PTAC) Cool Sch"
SIZING-OPTION = ADJUST-LOADS
SPACE = "Unit 100"
..
I solved this problem based on the approach provided by @chngzm. I share my code. This is not a fancy code but it works :)
First, I made a list of SPACE name. I used
try
andexcept
functions due to the text file includes some blank lines.and then, change each SYSTEM and ZONE name according to SPACE name from the list made above.
This code gave what I exactly wanted. I would appreciate it if you let me know any better/fancy approaches. Thanks again! @chngzm