0
국가에 대한 정보가 포함 된 2 개의 tsv 파일 (tec00104.tsv & tec00114.tsv)이 있습니다. 두 tsv 파일의 공통 국가에서 하나의 배열을 만들고 싶습니다. 그리고 따라 오는 가치들. 이게 효과가없는 것 같은데 왜?일반적인 값 (자바 스크립트)을 기반으로 2 개의 tsv 파일을 병합하는 방법
// initialize array
var countries = [];
for(var i = 0; i < "tec00114.tsv".length; i++)
{
for(var j = 0; j < "tec00104.tsv".length; j++)
{
// if the country code is found in both tsv files
if("tec00114.tsv"[i][2] === "tec00104.tsv"[j][3]);
{
// append new value to the array
countries.push("tec00114.tsv"[i]);
countries.push("tec00104.tsv"[j]);
}
}
}
console.log(countries);
단순히 액세스 할 수있는 파일을 발생하지 않습니다 문자열로 파일의 이름을 참조; JavaScript는 단순히 문자열 자체에 대해 이야기하고 있다고 생각합니다. – Pointy
[자바 스크립트 - 로컬 텍스트 파일 읽기] (http://stackoverflow.com/questions/14446447/javascript-read-local-text-file)? – Aprillion