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 GitHub - d3/d3-dsv: A parser and formatter for delimiter-separated values, such as CSV and TSV.

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

Thank you.