How to input data from a text file

I have created a text file where each line of the text file contains an x,y,z value ( separated by commas ) and a string which is a path to a jpg file.
I am using three.js to display these photos and to allow the user to browse them.
I can place the text file and jpgs on a server or on the local computer.
How can I open and parse the data of a text file in javascript?
Thank you.

var loader = new THREE.FileLoader();
loader.load( "your_file.txt", function( text ) {
  console.log( text );
} );

p.s.

to parse comma-separated data maybe try https://github.com/d3/d3-dsv/

Best option, a js file containing your data as an object.