Web Form JavaScript adjustments

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

<!DOCTYPE html>
<html>
  <head>
    <title>file reps</title>

</head>
<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">http://www.mysite.com/file/folder/blah/xxxxxx/_something_else here/zzzzzz/image250
http://www.mysite.com/file/folder/blah/xxxxxx/_something_else here/zzzzzz/image500
http://www.mysite.com/file/folder/blah/xxxxxx/_something_else here/zzzzzz/image800
http://www.mysite.com/file/folder/blah/xxxxxx/_something_else here/zzzzzz/image1000  </textarea>
	

	
    <script type="text/javascript">

		var reader = new FileReader();

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

		function readText(that){

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

</script>

</center>  </body>
</html>

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