Mail Archives: geda-user/2015/02/08/06:25:08
> On 7 Feb 2015, at 21:19, John Doty <jpd AT noqsi DOT com> wrote:
>> On Feb 7, 2015, at 1:44 PM, Chris Smith <space DOT dandy AT icloud DOT com> wrote:
>>
>> It's just a text file and AWK and sed are text processors.
>
> Except that they are line oriented. Things like AWK and cut are field oriented at the next level. What are your record and field punctuation? How would you do the following in your system?
>
> awk '/^C /{print $7}' Interface.*.sch | sort | uniq
This is what a simple schematic might look like as a valid Lua construct. I've deliberately formatted it to look as close to the gEDA format as possible:
schematic = { {
'v', 20110115, 2 },{
'C', 40000, 40000, 0, 0, 0, 'title-B.sym' },{
'C', 46000, 48700, 1, 0, 0, 'vcc-1.sym' },{
'C', 46100, 46000, 1, 0, 0, 'gnd-1.sym' },{
'C', 46300, 47600, 1, 90, 0, 'resistor-2.sym',
{
'T', 45950, 48000, 5, 10, 0, 0, 90, 0, 1,
device='RESISTOR' },{
'T', 46000, 48300, 5, 10, 1, 1, 180, 0, 1,
refdes='R1' },{
'T', 45700, 47800, 5, 10, 1, 1, 0, 0, 1,
value='10k' }
}, {
'C', 46300, 46500, 1, 90, 0, 'resistor-2.sym',
{
'T', 45950, 46900, 5, 10, 0, 0, 90, 0, 1,
device='RESISTOR' },{
'T', 46000, 47200, 5, 10, 1, 1, 180, 0, 1,
refdes='R2' },{
'T', 45700, 46700, 5, 10, 1, 1, 0, 0, 1,
value='20k' }
}, {
'N', 46200, 48500, 46200, 48700, 4 },{
'N', 46200, 47600, 46200, 47400, 4 },{
'N', 46200, 46500, 46200, 46300, 4 }
}
Chris
- Raw text -