diff --git a/bom.go b/bom.go index 2c8d709..e3296d3 100644 --- a/bom.go +++ b/bom.go @@ -37,7 +37,7 @@ func transBomFormat(commentId, designatorId, footprintId int, contents []string) lines := strings.Split(line, "\",") if commentId < len(lines) && designatorId < len(lines) && footprintId < len(lines) { footprint := transBomFootprint(lines[footprintId]) - ostr += lines[commentId] + "\"," + lines[designatorId] + "\"," + footprint + "\"\n" + ostr += lines[commentId] + "\"," + lines[designatorId] + "\"," + footprint + "\n" } } return ostr @@ -54,16 +54,16 @@ func transBomFootprint(footprint string) string { func findBomContents(content string) (commentId, designatorId, footprintId int, contents []string) { contents = strings.Split(content, "\n") for i, line := range contents { - if (strings.Contains(line, "\"Ref\"")) && + if (strings.Contains(line, "\"Reference\"")) && (strings.Contains(line, "\"Value\"")) && - (strings.Contains(line, "\"Footprint\"")) { + (strings.Contains(line, "\"MaterialFootprint\"")) { lines := strings.Split(line, ",") for j, item := range lines { - if item == "\"Ref\"" { + if item == "\"Reference\"" { designatorId = j } else if item == "\"Value\"" { commentId = j - } else if item == "\"Footprint\"" { + } else if item == "\"MaterialFootprint\"" { footprintId = j } }