From: Bdale Garbee Date: Wed, 14 Oct 2015 20:15:02 +0000 (-0600) Subject: script for extracting parts from a design to put in preferred parts db X-Git-Tag: telelco-v3.0~689 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=dc09ccbb864763cd3f96b9ea9261fc0c3c31f984;p=hw%2Faltusmetrum script for extracting parts from a design to put in preferred parts db --- diff --git a/bin/extract-board-parts b/bin/extract-board-parts new file mode 100755 index 0000000..f490972 --- /dev/null +++ b/bin/extract-board-parts @@ -0,0 +1,22 @@ +#!/bin/sh +# extract parts from a gEDA schematic for addition to preferred parts database +# Copyright 2015 Bdale Garbee , GPLv3+ +# assumes attribs file contents like: +# device +# value +# footprint +# loadstatus +# provided +# mfg_part_number +# vendor +# vendor_part_number + +gnetlist -g bom -o - $1.sch \ + | head -1 \ + | awk '{ printf("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", $2, $3, $4, $5, $6, $7, $8, $9) }' + +gnetlist -g bom -o - $1.sch \ + | tail -n +2 \ + | awk '{ printf("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", $2, $3, $4, $5, "no", $7, $8, $9) }' \ + | sort | uniq +