blob: 56af125164d0f4a8563561b1687c69ea8df00aea [file] [log] [blame]
Brian Silverman86c8feb2014-01-18 17:41:33 -08001#!/usr/bin/env ruby
2
3ElementRegex = /[ \t]*(Element[\[(].+) "(.*)" "(.*)" "(.*)" (.*)/
4
5File.open('cape.pcb') do |f|
6 $start_lines = f.readlines
7end
8
9File.open('cape.pcb', 'w') do |f|
10 $start_lines.each do |line|
11 match = ElementRegex.match(line)
12 if match
13 footprint = match[2]
14 refdes = match[3]
15 f.puts "#{match[1]} \"#{footprint}\" \"#{refdes}\" \"\" #{match[5]}"
16 else
17 f.puts line
18 end
19 end
20end