# awk script to strip off the total energy reading from the Landis+gyr meters BEGIN { }; /(C\.1\.0)/ { split($0, a, /[\(\*\)]/) serial=a[2] sub(/^0+/, "", serial) } # included the open parenthesis in the search text to suppress the # old recordings emitted by some power meters - 26.10.2017chk /(1\.8\.[01]\()/ { split($0, a, /[\(\*\)]/) power=a[2] sub(/^0+/, "", power) }; /(2\.8\.[01]\()/ { split($0, a, /[\(\*\)]/) ipower=a[2] sub(/^0+/, "", ipower) }; /(3\.8\.[01]\()/ { split($0, a, /[\(\*\)]/) rp1=a[2] sub(/^0+/, "", rp1) }; /(4\.8\.[01]\()/ { split($0, a, /[\(\*\)]/) rp2=a[2] sub(/^0+/, "", rp2) }; /(32\.7)((\.0)||(\())/ { split($0, a, /[\(\*\)]/) v1=a[2] }; /(52\.7)((\.0)||(\())/ { split($0, a, /[\(\*\)]/) v2=a[2] }; /(72\.7)((\.0)||(\())/ { split($0, a, /[\(\*\)]/) v3=a[2] }; /(31\.7)((\.0)||(\())/ { split($0, a, /[\(\*\)]/) i1=a[2] }; /(51\.7)((\.0)||(\())/ { split($0, a, /[\(\*\)]/) i2=a[2] }; /(71\.7)((\.0)||(\())/ { split($0, a, /[\(\*\)]/) i3=a[2] }; END { # This is because someone wired up the current coils wrongly for one unit if (serial=="94529479") { power=ipower } print power, v1, v2, v3, i1, i2, i3, rp1, rp2 }