This is the simple form I have right now and I need a little help making some minor tweaks if someone could help me.

HTML Code:
<!DOCTYPE html>
    <title>file reps</title>

<body style="zoom: 1.5"> <center>
	<input type="file" onchange='readText(this)' /> <br />

	<textarea rows=10 cols=84 id="txtReps">123456, 123000</textarea> <br />
		<button onclick="rip()">run script</button>
		<button onclick="output.value=output.defaultValue;">reset</button>
	<br />

	<textarea rows=10 cols=84 id="output"> here/zzzzzz/image250 here/zzzzzz/image500 here/zzzzzz/image800 here/zzzzzz/image1000  </textarea>

    <script type="text/javascript">

		var reader = new FileReader();

		function rip(e) {  
			var out=(e && && || output.value ;
			var reps=txtReps.value.split(/\s*,\s*/);
			output.value= out.split("\n").map(function(a){
				return a	.split("xxxxxx").join(reps[0])

		function readText(that){

			if(that.files && that.files[0]){
				var reader = new FileReader();
				reader.onload = rip;
			}//end if html5 filelist support


</center>  </body>

I want the "xxxxxx" numbers to only go in first box separated by a commas with no limits while automatically splitting each set of numbers into their own set of lists with the "zzzzzz" numbers added to output. Only thing that's happening is the "xxxxxx" numbers are being changed to have "000" replace the last 3 numbers and that will be what the "zzzzzz" number is. See photo for a clearer example. Hope that makes sense. Thanks