Question
I have an Excel file that has multiple sheets with names that may change.
Is there a good way to get the name of each sheet and then read the data?
Answer
We recommend that you use the following procedure to read the sheet names and data from the file.
Procedure
- Obtain sheet names using Get Sheet Names operation.
- Place Loop by Number of Data operation and specify "/book/sheet" for [Separation path]* in the [XML Data Processing] tab in the properties.
- Place Mapper and connect from "/book/sheet" in the input schema to a variable.
- Read data using the Read from Sheet operation.
*Get Sheet Names operation uses the following XML type schema.
<book>
<sheet>{Sheet1}</sheet>
<sheet>{Sheet2}</sheet>
…
</book>
For this reason, in the properties of Loop by Number of Data operation, specify "/book/sheet" for [Separation path] in the XML Data Processing tab.
For details on each operation and logic, please refer to the following pages.
Get Sheet Names
https://www.hulft.com/help/en-us/HULFTSquare/Content/Designer/Connector/excel_get_sheet_name.htm
Loop by Number of Data
https://www.hulft.com/help/en-us/HULFTSquare/Content/Designer/Connector/flow_loop_by_number_of_data.htm
Comments
0 comments
Article is closed for comments.