How to read certain specified fields from text file in javascript <p>I am using text file data for my script. I am loading the text file and getting the data from it. The text file contains data as below.</p> <pre><code>'DoctorA': {name: "Pharmaceuticals", title: "Switzerland, 120000 employees"}, 'DoctorB': {name: "Consulting", title: "USA, 5500 employees"}, 'DoctorC': {name: "Diagnostics", title: "USA, 42000 employees"}, 'DoctorD': {name: "Fin Serv. &amp; Wellness", title: "South Africa, employees"}, </code></pre> <p>I load and use something like this to read the data from that text file.</p> <pre><code>data.speakers=names_val[0]; </code></pre> <p>I have not fully specified my script. My problem is I am getting the entire text file when I load into data.speakers. Is there anyway to read only that <em>title</em>: fields or only that <em>name</em>: field</p>