Microsoft Dev Blogs

Convert Specific Table of Excel Sheet to JSON

thumbnail

Title: Convert Specific Table of Excel Sheet to JSON Author: Sonam Rastogi Date: April 11th, 2023

Summary:

  • The script on GitHub can convert a full Excel sheet to JSON, but this article focuses on converting a specific table among various tables available within a sheet in an Excel file.
  • The requirement is to read students' data from the Science sheet, which contains multiple tables.
  • The script accepts three parameters: path of the input Excel file, name of the sheet inside the Excel file, and name of the table within the Excel sheet.
  • The header row starts one row after the class name, and the student data row starts one row after the header row.
  • The script extracts the header column names, and duplicate columns are not added again.