ExcelArrayFromFile
From GECK
A function added by the SUP NVSE Plugin.
Contents
Description
Reads from specified XLS file to array.
Syntax
(FromFile:array_var) ExcelArrayFromFile filepath:string WorksheetID:int Row_or_Column_Number:int Read_row(0/1):int
Or:
(FromFile:array_var) XLSArrayFromFile filepath:string WorksheetID:int Row_or_Column_Number:int Read_row(0/1):int
Example
array_var ar_FromFile let ar_FromFile := ExcelArrayFromFile "aaExcelFile" 0 0 0
Will read from column 0, sheet#0 from file aaExcelFile.XLS
aaExcelFile.xls contents:
A |
B | C | D | |
---|---|---|---|---|
1 | MyString | |||
2 | 1 | |||
3 | *FalloutNV.esm:15837B | |||
4 | *OldWorldBlues.esm:015DD3 | |||
5 | *GunRunnersArsenal.esm:000853 |
Array output:
[ 0.000000 ] : MyString [ 1.000000 ] : 1.000000 [ 2.000000 ] : Gauss Rifle (0015837B) [ 3.000000 ] : Elijah's Advanced LAER (03015DD3) [ 4.000000 ] : Plasma Defender (GRA) (05000853)
Notes
- If file doesn't exist or can't be loaded (i.e. - it's open in Excel at the moment) - function returns -1.
- All to-build references must be prefixed with "*" and have the same structure as in example.
- Strings and floats do not need to be prefixed.