vgulielmus
Programmer
Just finished a new version of ImportFromXlsx
In version 1.3 I've added a new (fifth) parameter. Very useful for worksheets with gaps (empty cells), but the process is slower.
If the fifth parameter, llEmptyCells, is passed as .T., then column position and data type is checked for each cell (much slower)
Please download from ImportFromXlsx 1.3
Direct link
ImportFromXlsx 1.3
General description
Import data from an Excel 2007+ workbook (xlsx). Excel presence is not required.
- return the name of the generated DBF / cursor; the same name with de xlsx / SYS(2015); empty string on error
- By default, analyze the first (imported) row of the xlsx table and get the number of columns and data types from this row
If the fifth parameter, llEmptyCells is passed as .T., then column position and data type is checked for each cell (much slower)
- creates a DBF / cursor (according to the fourth parameter)
- and populate this DBF with data from the xlsx
- the field are named mField1,mField2 and so on
- the size and precision of the numeric field is calculated with MAX(LEN(ALLTRIM(cell value))), respectively with MAX(LEN(ALLTRIM(cell value))-AT(decimal separator,ALLTRIM(cell value))
- the length of character fields is MAX(LEN(cell value))
- if MAX(LEN(cell value)) > 254 and contains at least one CHR(13), the field is MEMO
Miscelaneous
- By default is imported the first sheet, no matter which name has
- Sheet can be passed by name (string), or by position (number)
- Files can be extracted with winrar
Respectfully,
Vilhelm-Ion Praisach
Resita, Romania
In version 1.3 I've added a new (fifth) parameter. Very useful for worksheets with gaps (empty cells), but the process is slower.
If the fifth parameter, llEmptyCells, is passed as .T., then column position and data type is checked for each cell (much slower)
Please download from ImportFromXlsx 1.3
Direct link
ImportFromXlsx 1.3
General description
Import data from an Excel 2007+ workbook (xlsx). Excel presence is not required.
- return the name of the generated DBF / cursor; the same name with de xlsx / SYS(2015); empty string on error
- By default, analyze the first (imported) row of the xlsx table and get the number of columns and data types from this row
If the fifth parameter, llEmptyCells is passed as .T., then column position and data type is checked for each cell (much slower)
- creates a DBF / cursor (according to the fourth parameter)
- and populate this DBF with data from the xlsx
- the field are named mField1,mField2 and so on
- the size and precision of the numeric field is calculated with MAX(LEN(ALLTRIM(cell value))), respectively with MAX(LEN(ALLTRIM(cell value))-AT(decimal separator,ALLTRIM(cell value))
- the length of character fields is MAX(LEN(cell value))
- if MAX(LEN(cell value)) > 254 and contains at least one CHR(13), the field is MEMO
Miscelaneous
- By default is imported the first sheet, no matter which name has
- Sheet can be passed by name (string), or by position (number)
- Files can be extracted with winrar
Respectfully,
Vilhelm-Ion Praisach
Resita, Romania