I need to decode a part that comes after 333.
This is a weather code it are numbers and the part before 333 I can already decode but I need a part after the 333 and it looks the same as #1sttt what do I need to do to decode that part? This is the code I have now to decode the first part before 333.
# Groups that aren't 5 figures get deleted.
for ($I=0; $I<$#GROUPS; $I++) {
last if ($GROUPS[$I] =~ /333|444|555|ICE/);
if (length($GROUPS[$I]) != 5) { splice(@GROUPS,$I,1) }
};
#1sttt
($GROUP_ID,$S,$T)=(shift(@GROUPS) =~ /(.)(.)(...)/);
if ($GROUP_ID eq "1" {
if ($T =~ /\d{3}/ and $S =~ /0|1/) {
$T=$T/10.;
if ($S) { $T=-$T }
} else {
undef $T
}
} else {
unshift(@GROUPS,$GROUP_ID.$S.$T); undef $T
};
This is after 333 but is not working.
# 1sTTT
($GROUP_ID,$Sn,$TX)=(shift(@GROUPS) =~ /(.)(.)(...)/);
if ($GROUP_ID eq "1" {
if ($TX =~ /\d{3}/ and $Sn =~ /0|1/) {
$TX=$TX/10.;
if ($Sn) { $TX=-$TX }
} else {
undef $TX
}
} else {
unshift(@GROUPS,$GROUP_ID.$Sn.$TX); undef $TX
};
Hope you know the answer.
Marcel
This is a weather code it are numbers and the part before 333 I can already decode but I need a part after the 333 and it looks the same as #1sttt what do I need to do to decode that part? This is the code I have now to decode the first part before 333.
# Groups that aren't 5 figures get deleted.
for ($I=0; $I<$#GROUPS; $I++) {
last if ($GROUPS[$I] =~ /333|444|555|ICE/);
if (length($GROUPS[$I]) != 5) { splice(@GROUPS,$I,1) }
};
#1sttt
($GROUP_ID,$S,$T)=(shift(@GROUPS) =~ /(.)(.)(...)/);
if ($GROUP_ID eq "1" {
if ($T =~ /\d{3}/ and $S =~ /0|1/) {
$T=$T/10.;
if ($S) { $T=-$T }
} else {
undef $T
}
} else {
unshift(@GROUPS,$GROUP_ID.$S.$T); undef $T
};
This is after 333 but is not working.
# 1sTTT
($GROUP_ID,$Sn,$TX)=(shift(@GROUPS) =~ /(.)(.)(...)/);
if ($GROUP_ID eq "1" {
if ($TX =~ /\d{3}/ and $Sn =~ /0|1/) {
$TX=$TX/10.;
if ($Sn) { $TX=-$TX }
} else {
undef $TX
}
} else {
unshift(@GROUPS,$GROUP_ID.$Sn.$TX); undef $TX
};
Hope you know the answer.
Marcel