1st solution: With your shown samples please try following awk code.
awk '
match($0,/(([0-9]+#)+);[^|]*/){
num=split(substr($0,RSTART,RLENGTH),arr,";")
for(i=1;i<num;i++){
sub(/#$/,"",arr[i])
gsub(/#/,"|",arr[i])
print $0"|"arr[i]
}
next
}
{
print $0 "|||"
}
' Input_file
2nd solution: Using function approach in awk, with your shown samples please try following awk code. We can pass number of fields into function what we want to look and get values for, eg: in this case I am passing 2nd, 3rd and 4th field numbers into the function to work on them to get required output. But in case you have too many fields then I suggest use the 1st solution of mine shown above.
awk -F' |;' '
function getValues(fields){
num=split(fields,arr,",")
for(i=1;i<=num;i++){
if($arr[i]~/^([0-9]+#)+[0-9]*$/){
val=$arr[i]
sub(/#$/,"",val)
gsub(/#/,"|",val)
print $0"|"val
}
}
}
/([0-9]+#)+;/{
getValues("2,3,4")
next
}
{
print $0 "|||"
}
' Input_file
In both the solutions, output will be as follows:
A|B|C|D| 3#1#1#;1#4#4;5#1#4;|E|F|0|3|1|1
A|B|C|D| 3#1#1#;1#4#4;5#1#4;|E|F|0|1|4|4
A|B|C|D| 3#1#1#;1#4#4;5#1#4;|E|F|0|5|1|4
AE|B1|CC|DE| |EX|FF|0|||
AR|BE|CA|D1| 5#6#3#;4#3#4;|ED|G||5|6|3
AR|BE|CA|D1| 5#6#3#;4#3#4;|ED|G||4|3|4