Root/boom/mbq2lst

1#!/usr/bin/perl
2
3#
4# Format:
5#
6# number comp_ref_category footprint value ...
7#
8
9print "eeschema (whatever) >> some date\n\n";
10print "#Cmp ( order = Reference )\n";
11while (<>) {
12    last if /^#END\b/;
13    s/#.*//;
14    next if /^\s*$/;
15    @a = split(/\s+/, $_);
16    $n = shift @a;
17    $cref = shift @a;
18    $fp = shift @a;
19    $value = shift @a;
20    for ($i = 0; $i != $n; $i++) {
21        $p++;
22        print "| $cref$p\t$value\t; $fp\t";
23        for (@a) {
24            print "; $_\t";
25        }
26        print "\n";
27    }
28}
29print "#End Cmp\n";
30

Archive Download this file

Branches:
master



interactive