[업데이트를 무시할 수 있습니다 : 플래시/액션 스크립트와 달리 내 대답은, HTML/자바 스크립트 AIR를 가정합니다. AS3 쪽에서 더 좋은 답변이있을 수 있습니다 ...]
언제든지 FileStream을 통해 읽고 CSV 파서를 직접 작성하는 저수준 접근 방식을 사용할 수 있습니다. 나는 임의의 CSV를 SQLite에 입력 할 수있는 선재 라이브러리를 찾을 수 있을지는 모르겠다. 그러나 아마도 나는 틀렸다 (나는 보지 않았다).
FileStream 리더로 시작하려는 기본 사항은 비동기 입력시 한 줄을 읽는이 예제 코드와 같습니다. 이 예제는 별도의 프로세스에서 STDOUT을 읽는 것이지만 FileStream에 직접 적용해야합니다.
this.process.addEventListener(air.ProgressEvent.STANDARD_OUTPUT_DATA, function(event) {
// call into _stdoutHandler...
});
Foo.prototype._stdoutHandler = function() {
var nBytes = this.process.standardOutput.bytesAvailable;
var msg = this.process.standardOutput.readUTFBytes(nBytes);
// The native process might send us partial lines, due to async IO.
// Reconstruct the whole lines.
this._sofar += msg;
while (true) {
var idx = this._sofar.indexOf("\n");
if (idx < 0)
break;
if (idx > 0) { // skips blank lines
var line = this._sofar.substring(0, idx);
this._foundLine(line);
}
if (this._sofar.length > idx + 1) {
this._sofar = this._sofar.substring(idx+1);
} else {
this._sofar = "";
}
}
var lines = this._sofar.split(/\n/);
if (lines.length > 1) {
air.trace("programming error: we should have already handled all newlines");
}
this._sofar = lines[lines.length - 1];
};
Foo.prototype._foundLine = function() {
// process a single line of input here...
};
CSVlib라는 오픈 소스 CSV 해석 작업 스크립트 라이브러리가 있습니다. – Damon