Mail Archives: geda-user/2016/01/08/10:29:43
John Doty <jpd AT noqsi DOT com> writes:
> On Jan 8, 2016, at 8:20 AM, Stephan Böttcher <geda AT psjt DOT org> wrote:
>
>> "Matt Rhys-Roberts (matt DOT rhys-roberts AT envinsci DOT co DOT uk) [via
>> geda-user AT delorie DOT com]" <geda-user AT delorie DOT com> writes:
>>
>>> How could I search a directory of .sch schematic sheets for components
>>> that contain a specific attribute, e.g. OrderCode=1234567, please?
>>> Basically, I need to fit components manually to a board, one specific
>>> type at a time, to keep production neat. So I need to list them by
>>> unique order code, ideally.
>>
>> I'd use awk
>>
>> $ awk '/^refdes=/{R=$0};/^value=10M/{print FILENAME, R, $0}' *.sch
>
> Assumes refdes comes first, which may not alway be true.
True, it can be improved, like
$ awk '/^refdes=/{R=$0};/^value=10M/{V=$0};/^}/ && V {print FILENAME, R, V; R=0; V=0}' *.sch
That's also not perfect.
If it goes into a script it can be fixed with a little effort. But what
I need today is not what I need tomorrow, so I type these kind of
commandlines every day. They are improved until they work and no more.
And when they work, they often get '|sh' appended, to do the real job.
>> CSA-Beau-F.sch refdes=R1 value=10MΩ
>> CSA-Beau-F.sch refdes=R51 value=10MΩ
>> eptpreamps.sch refdes=R13 value=10MΩ
>> eptpreamps.sch refdes=R14 value=10MΩ
>> eptpreamps.sch refdes=R15 value=10MΩ
>> eptpreamps.sch refdes=R16 value=10MΩ
>> hetpreamps.sch refdes=R13 value=10MΩ
>> hetpreamps.sch refdes=R14 value=10MΩ
>> hetpreamps.sch refdes=R15 value=10MΩ
>> hetpreamps.sch refdes=R16 value=10MΩ
>>
>> --
>> Stephan
>>
>>
>
> John Doty Noqsi Aerospace, Ltd.
> http://www.noqsi.com/
> jpd AT noqsi DOT com
>
>
--
Stephan Böttcher Tel: +49-431-880-2508
Extraterrestrische Physik, IEAP, Leibnizstr. 11, 24118 Kiel
- Raw text -