package main

import (
	"fmt"

	"github.com/xuri/excelize/v2"
)

func main() {
	file := "AMF-PM(V1.1.5)-Company-Version00.xlsx"
	f, err := excelize.OpenFile(file)
	if err != nil {
		fmt.Println(err.Error())
		return
	}

	list := f.GetSheetList()
	if err != nil {
		fmt.Println(err.Error())
		return
	}
	fmt.Println(list)
	neType := file[0:3]
	fmt.Println("neType:", neType)
	for _, s := range list {
		if s[0] == 'H' {
			rows, _ := f.GetRows(s)
			var kpiCode string
			for _, row := range rows[1:] {
				if row[0] != "" {
					kpiCode = row[0]
				}
				fmt.Print(kpiCode, "\t", row[2], "\t", row[3], "\t", row[4], "\n")
			}
		}
	}

}
