开发者

Reading CSV/xlsx file in FLEX AIR

开发者 https://www.devze.com 2023-01-10 09:27 出处:网络
HI, I have a requirement to read CSV/Xlsx file in my FLEX AIR. 开发者_JS百科var strFilePath :String = File.applicationDirectory.nativePath + \"\\Test.xlsx\";

HI,

I have a requirement to read CSV/Xlsx file in my FLEX AIR.

开发者_JS百科var strFilePath :String = File.applicationDirectory.nativePath + "\Test.xlsx"; var recurFile :File = new File(strFilePath);

var stream :FileStream = new FileStream(); stream.open(recurFile, FileMode.READ); var content :String = String(stream.readUTFBytes(stream.bytesAvailable)); But variable content always has "PK.." .. is some hexadecimal character.

I tried to laod using URLLoader but still got same result.

Please give me correct code to read xlsx/csv files.


You might want to check out the following library:

http://code.google.com/p/as3xls/

CSV files are a lot easier to handle, and there are some good looking tutes if you Google for 'Read CSV file in AIR'

0

精彩评论

暂无评论...
验证码 换一张
取 消