Create mouser parts list file in a directly-importable form
authorKeith Packard <keithp@keithp.com>
Fri, 13 Nov 2015 01:22:48 +0000 (17:22 -0800)
committerKeith Packard <keithp@keithp.com>
Fri, 13 Nov 2015 01:22:48 +0000 (17:22 -0800)
Signed-off-by: Keith Packard <keithp@keithp.com>
bin/partslist-vendor

index e813ec73b592c724cc20338f656f9123b1042abe..7454a92842be9847d376bc6a98f7d91b14929be6 100755 (executable)
@@ -127,7 +127,19 @@ void process_mouser(string[string] entry)
 {
        if (entry["loadstatus"] == "noload")
                return;
-       printf("%s|%s\n", part_number(entry), entry["quantity"]);
+/*     printf("%s|%s\n", part_number(entry), entry["quantity"]); */
+
+       static bool start = true;
+
+       if (start) {
+               printf("Mouser Part Number,Manufacturer Part Number,Quantity 1\n");
+               start = false;
+       }
+
+       printf("%s,%s,%s\n",
+              entry["vendor_part_number"],
+              entry["mfg_part_number"],
+              entry["quantity"]);
 }
 
 void process_other(string[string] entry) {