Here is awk
apporach:
awk '{firstSeven=substr($0,1,7);gsub(/,/,RS firstSeven)}1' inputfile
990202-1711-BBVRS390-T01
415715-1611-EDUE818C
415715-1711-EDUE818C
415715-1611-EDUE818C-
415715-1711-EDUE818C-T01
Exaplanation:
substr
function : This function is used to get the first seven characters.From 1st character to 7th character.
gsub
function: This function is used to replace a comma with New line followed by firstSeven Characters. Here RS
is used to get new line as the default vale of RS
is new line.
To do the changes inside the file use -inplace
option of awk ,if it is not available :
awk '{firstSeven=substr($0,1,7);gsub(/,/,RS firstSeven)}1' inputfile >inputfile.tmp && mv inputfile.tmp inputfile