ID: | 1216 |
From: | Peter Stuge <pe...@stuge.se> |
Date: | Sun, 7 Jan 2018 02:19:02 +0000 |
Subject: | Re: [pcb-rnd] default clearance in new subcircuit footprints, fixing |
in-reply-to: | 1215 from John Griessen <jo...@cibolo.com> |
--enLffk0M6cffIOOh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline John Griessen wrote: > Also I want to make a script to change past ones I've made and awk seems > difficult since the task is to make a change 'inside braces starting here > until close braces found', and awk's line by line operation means counting > braces found to decide what to do, which sounds difficult. It's actually not too difficult. The attached awk program works for me. All scopes below the ha:top layer are processed, except scopes which open and close on the same line. More stanzas can be added before the last print to do further processing on (ie. in scopes below) the desired layer. Please use diff -u to verify the result; I haven't tested this much. //Peter --enLffk0M6cffIOOh Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="onelayer.awk" #usage: awk -f onelayer.awk file.lht > new.lht BEGIN { depth=1; layer=0 } /\{ .* \}/ { print; next } /\{$/ { depth++ } /\}$/ { if (depth-- == layer) layer=0 } / ha:top / { layer=depth } { if (!layer || depth < layer) { print; next } } / clearance = / { sub(/= 40mil$/, "= 0.3mm") } / clearpoly = / { sub(/clearpoly =/, "clearpolypoly =") } { print } --enLffk0M6cffIOOh--
Reply subtree:
1216 Re: [pcb-rnd] default clearance in new subcircuit footprints, fixing from Peter Stuge <pe...@stuge.se>