Как вариант...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1251' />
<script src='http://code.jquery.com/jquery-latest.js'></script>
<!--
<script src="https://code.angularjs.org/1.3.9/angular.min.js"></script>
<script src="https://code.angularjs.org/1.3.9/angular-route.js"></script>
-->
<style type='text/css'>
textarea {
width: 90%;
height: 200px;
margin-left: auto;
margin-right: auto;
}
</style>
<script type='text/javascript'>
$(function (){
$('button').click(function (){
var val=$('#before').val();
var reg=/(\d+):(.+)/g;
val=val.replace(reg,'{value:$1,list: [$2]}')
val=val.replace(/\n|\|/g,',');
$('#after').val(val)
});
});
</script>
</head>
<body>
<div>
<textarea id="before">6:MDX|NSX|A5
7:M3|M6|X5|X6</textarea>
<textarea id="after"></textarea>
</div>
<button>GEN</button>
</body>
</html>