Extract Specific Text Data From Multiple Lines

/*<!DOCTYPE html>
<html>
<body>

<p>Click the button to display the array values after the split.</p>

<button onclick="myFunction()">Try it</button>


<textarea id="ta">INPUT</textarea>


<textarea id="demo">OUTPUT</textarea>

<script>
-- THIS IS NOT THE EMULATOR VERSION.
*/

var res = "new Array(";
function myFunction() {

    // get single line
    var lines = document.getElementById("ta").value.split('\n');

    let _read = new Array();
    let _together = "";
    
    //var linesx = document.getElementById("ta").value.split(',')[2];
    for(var i = 0;i < lines.length;i++){
      //code here using lines[i] which will give you each line
    
    _together = "["+lines[i].split(',')[0] +","; 
    
    _together += lines[i].split(',')[1] + ",";
    
    _together += lines[i].split(',')[2] + ",";
    
    _together += '"' + lines[i].split(',')[7] + '"],\n';
    
    _together = _together.replace(/^| /g,'');
    
    
      _read.push(_together);//ignore past 3rd comma
      //res += linesx[i]+"<br />";
    }

    for(var i = 0;i < _read.length;i++){

          res += _read[i];
    }
    
    res += ");";
    document.getElementById("demo").innerHTML = res;
}//end fn


/*
</script>
</body>
</html>
*/

Latest Posts

Emulation ProcessEmulation Process

  Record Locs for Emulation in Core Grab data. Here, I am recording x,yz, and name data to emulate. Next Convert to usable array for Core template data. Snippet>> Pattern  Core template replacement pattern: Path:[C:\Users\soandso\Documents\My Games\CORE\Saved\Maps\mycoregame\Data\Tree\Emulator_