$file_in = "file_in.txt"
$file_out = "file_out.txt"
$out = ""
$count = TFCOUNT("file_in.txt")
LOGWRITE ("Входящих строк: ", $count)
FOR($i=1, $i < ($count+1))
$str = TFREAD($file_in, $i)
$ind = STRCUT2 ($str, 1, STRPOS ($str,":")-1)
IF($out = "")
$out = $str
$index = $ind
ELSE
IF($index = $ind)
$data = STRCUT2 ($str, STRPOS ($str,":")+1, 999)
$out = STRCONCAT($out, " ", $data)
ELSE
TFWRITE($file_out, $out)
$out = $str
$index = $ind
END_IF
END_IF
END_CYC
TFWRITE($file_out, $out)
HALT