Initial commit

This commit is contained in:
Nick Playfair 2020-12-21 17:16:15 +00:00
commit 8d2bb35521
6 changed files with 103 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
.DS_Store
._*
node_modules/

12
index.js Normal file
View File

@ -0,0 +1,12 @@
const csvFilePath = './mkII.csv'
const csv = require('csvtojson')
csv({
delimiter: ";",
includeColumns: /(Part|Value)/,
ignoreEmpty: true
})
.fromFile(csvFilePath)
.then(parts => {
console.log(parts)
})

29
mkII.csv Normal file
View File

@ -0,0 +1,29 @@
"Part";"Value";"Device";"Package";"Description";"";
"ATTACK";"B1K";"16MM.3";"16MM_C.MOUNT";"16mm Poteniometers";"";
"C1";"10nF";"CAP.2";"0.2".SML";"For Ceramic, Film, MLCC caps";"";
"C2";"4u7";"5MM.1";"0501";"5mm diameter caps";"";
"C3";"100nF";"CAP.2";"0.2".SML";"For Ceramic, Film, MLCC caps";"";
"C4";"10nF";"CAP.2";"0.2".SML";"For Ceramic, Film, MLCC caps";"";
"C5";"4u7";"5MM.1";"0501";"5mm diameter caps";"";
"C6";"10uF";"CPOL-EUE2.5-5";"E2,5-5";"POLARIZED CAPACITOR, European symbol";"";
"C7";"100uF";"CPOL-EUE2.5-6";"E2,5-6";"POLARIZED CAPACITOR, European symbol";"";
"C8";"10uF";"CPOL-EUE2.5-5";"E2,5-5";"POLARIZED CAPACITOR, European symbol";"";
"D1";"1N4148";"DO35.2";"DO35-2";"1n914, BAT4x, 1n34a";"";
"D2";"1N4001";"DO41.3";"DO41-3";"1N400x, 1N5817";"";
"G";"LSP10";"LSP10";"LSP10";"SOLDER PAD drill 1.0 mm, distributor Buerklin, 12H555";"";
"IC1";"ICL7660CPA";"ICL7660CPA";"DIL08";"VOLTAGE CONVERTER";"";
"J1";"LSP10";"LSP10";"LSP10";"SOLDER PAD drill 1.0 mm, distributor Buerklin, 12H555";"";
"J2";"LSP10";"LSP10";"LSP10";"SOLDER PAD drill 1.0 mm, distributor Buerklin, 12H555";"";
"Q1";"GT308";"GT308";"TO-5";"";"";
"Q2";"GT308";"GT308";"TO-5";"";"";
"Q2BIAS";"100K";"TRIMMER";"TRIM1";"Trimpots";"";
"Q3";"GT308";"GT308";"TO-5";"";"";
"Q3BIAS";"10K";"TRIMMER";"TRIM1";"Trimpots";"";
"R1";"100K";"RESISTORS.3B";"0.3".B";"1/8W, 1/4W and 1W resistors";"";
"R2";"10K";"RESISTORS.3B";"0.3".B";"1/8W, 1/4W and 1W resistors";"";
"R3";"470R";"RESISTORS.3B";"0.3".B";"1/8W, 1/4W and 1W resistors";"";
"R4";"100K";"RESISTORS.3B";"0.3".B";"1/8W, 1/4W and 1W resistors";"";
"TP1";"TPSPAD1-13";"TPSPAD1-13";"P1-13";"TEST PIN";"";
"TP2";"TPSPAD1-13";"TPSPAD1-13";"P1-13";"TEST PIN";"";
"U$1";"IO_V2";"IO_V2";"IO_LARGER";"";"";
"VOL";"A100K";"16MM.3";"16MM_C.MOUNT";"16mm Poteniometers";"";
Can't render this file because it contains an unexpected character in line 3 and column 25.

41
package-lock.json generated Normal file
View File

@ -0,0 +1,41 @@
{
"name": "bom2table",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"bluebird": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg=="
},
"csvtojson": {
"version": "2.0.10",
"resolved": "https://registry.npmjs.org/csvtojson/-/csvtojson-2.0.10.tgz",
"integrity": "sha512-lUWFxGKyhraKCW8Qghz6Z0f2l/PqB1W3AO0HKJzGIQ5JRSlR651ekJDiGJbBT4sRNNv5ddnSGVEnsxP9XRCVpQ==",
"requires": {
"bluebird": "^3.5.1",
"lodash": "^4.17.3",
"strip-bom": "^2.0.0"
}
},
"is-utf8": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
"integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI="
},
"lodash": {
"version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="
},
"strip-bom": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
"integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
"requires": {
"is-utf8": "^0.2.0"
}
}
}
}

14
package.json Normal file
View File

@ -0,0 +1,14 @@
{
"name": "bom2table",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "nplayfair",
"license": "MIT",
"dependencies": {
"csvtojson": "^2.0.10"
}
}

3
test.csv Normal file
View File

@ -0,0 +1,3 @@
"Part";"Value";"Device";"Package";"Description";"";
"C1";"10nF";"CAP.2";"0.2".SML";"For Ceramic, Film, MLCC caps";"";
"R1";"100K";"RESISTORS.3B";"0.3".B";"1/8W, 1/4W and 1W resistors";"";
Can't render this file because it contains an unexpected character in line 2 and column 25.