Nexial Automation

Test Automation Platform for everyone!

X

localdb » importEXCEL(var,excel,sheet,ranges,table)

Description

This command imports a portion of data from an Excel (excel) worksheet (sheet) into a table in the embedded database. Use ranges to specify one or more contiguous cell areas, which may be disjointed or overlapped. However, the first row of the specified ranges will be considered as the column headers for import. If target table does not yet exist, Nexial will attempt to create it. However due to the dynamic data typing nature of SQLite, the autogenerated table might not be generated in the exact specification as one might expect. To ensure precision, it would be advisable to create the desired target table beforehand via runSQLs(var,sqls). That said, it should be fairly safe to let Nexial generate the missing target table for importing simple Excel data.

Note that this command WILL NOT remove any existing records from table.

Parameters

  • var - the data variable to store the outcome of import
  • excel - the location of the Excel file to import
  • sheet - the name of the worksheet to import
  • ranges - one or more cell ranges to import. The row will be treated as column headers. For example, A1:K24,B99:T:121
  • table - the target table to import data

Example

Script:

Output:

See Also