X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-TCPREMOTEIP: 63.119.35.194 X-Authenticated-UID: jpd AT noqsi DOT com Content-Type: multipart/signed; boundary="Apple-Mail=_12E2BA9E-8637-40FA-B050-3BB9DBE86DB4"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: [geda-user] Searching for refdes's having a specific attribute? X-Pgp-Agent: GPGMail 2.5.2 From: John Doty In-Reply-To: Date: Fri, 8 Jan 2016 10:45:22 -0500 Message-Id: References: <568F9808 DOT 5040808 AT envinsci DOT co DOT uk> <98DD4EFF-C1B7-4D51-9C99-DB0E04A99AAC AT noqsi DOT com> To: geda-user AT delorie DOT com X-Mailer: Apple Mail (2.1878.6) Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk --Apple-Mail=_12E2BA9E-8637-40FA-B050-3BB9DBE86DB4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On Jan 8, 2016, at 10:29 AM, Stephan B=C3=B6ttcher = wrote: > John Doty writes: >=20 >> On Jan 8, 2016, at 8:20 AM, Stephan B=C3=B6ttcher = wrote: >>=20 >>> "Matt Rhys-Roberts (matt DOT rhys-roberts AT envinsci DOT co DOT uk) [via >>> geda-user AT delorie DOT com]" writes: >>>=20 >>>> How could I search a directory of .sch schematic sheets for = components >>>> that contain a specific attribute, e.g. OrderCode=3D1234567, = 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. >>>=20 >>> I'd use awk >>>=20 >>> $ awk '/^refdes=3D/{R=3D$0};/^value=3D10M/{print FILENAME, R, $0}' = *.sch >>=20 >> Assumes refdes comes first, which may not alway be true. >=20 > True, it can be improved, like >=20 > $ awk '/^refdes=3D/{R=3D$0};/^value=3D10M/{V=3D$0};/^}/ && V {print = FILENAME, R, V; R=3D0; V=3D0}' *.sch >=20 > That's also not perfect. >=20 > 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. Same here. > They are improved until they work and no more. > And when they work, they often get '|sh' appended, to do the real job. >=20 >>> CSA-Beau-F.sch refdes=3DR1 value=3D10M=CE=A9 >>> CSA-Beau-F.sch refdes=3DR51 value=3D10M=CE=A9 >>> eptpreamps.sch refdes=3DR13 value=3D10M=CE=A9 >>> eptpreamps.sch refdes=3DR14 value=3D10M=CE=A9 >>> eptpreamps.sch refdes=3DR15 value=3D10M=CE=A9 >>> eptpreamps.sch refdes=3DR16 value=3D10M=CE=A9 >>> hetpreamps.sch refdes=3DR13 value=3D10M=CE=A9 >>> hetpreamps.sch refdes=3DR14 value=3D10M=CE=A9 >>> hetpreamps.sch refdes=3DR15 value=3D10M=CE=A9 >>> hetpreamps.sch refdes=3DR16 value=3D10M=CE=A9 >>>=20 >>> -- >>> Stephan >>>=20 >>>=20 >>=20 >> John Doty Noqsi Aerospace, Ltd. >> http://www.noqsi.com/ >> jpd AT noqsi DOT com >>=20 >>=20 >=20 > -- > Stephan B=C3=B6ttcher Tel: +49-431-880-2508 > Extraterrestrische Physik, IEAP, Leibnizstr. 11, 24118 Kiel >=20 >=20 John Doty Noqsi Aerospace, Ltd. http://www.noqsi.com/ jpd AT noqsi DOT com --Apple-Mail=_12E2BA9E-8637-40FA-B050-3BB9DBE86DB4 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJWj9mTAAoJEF1Aj/0UKykR9/oP/3xHn9SLe24CdFZTQBYvWlUN 8P4JU9xRzLjEOJCeE28nOiFM533QLFINyqyWUD4QpYyT6hlr+Uh+KBT8IIb4zXul 3vqITRHKmbEz/gog7hmecg+RHffR/Y5yF3rp3DwIQZTnC9q5wTTTOMU87t5OFSzg WBosZXV2Ueehqaf+kmHHtyYy4owQu1JtBXhqwswkHLq++aTYos576AzyeK89BYWq jzGYUX9e4aJyZZLw/NQg7ko+Ik6p++pJ04ybrLPZLay6GUZWrM/hVcRAvZa7LTLN qK51O225znqZgPllECRe40XzyyRkPcZO0zGyjHmQ5TloaC+WSTjp5LZCxraKkaNg 90calS2OQo87gxJinAcQiNX9Y1aRBQXEjnqw7FIuWXRh6pfONzXkSOxjR9AhPlIc LvFADIsYlBtZ24IKB+3o2vyDhLqZB1nal/0SmBOyLjxHyQKAELhI0ObYCxLnmNTN Y7/ZpPvjFXn4JcpiD+u9ySrivSqBSRXisBSrWIz8cuXCV2lARlblewjt/U7rUmQe f2XtvZgz3Atq3M277USy2dJIG//q25BgWRhrpIvuP8Mcqqn5pw3VJujnsxl9gjko zMcDCaUrFUWrsF5tSB4Wb9yZmUH2U5HUeAnMM95h6FTdCQenzG7IuEYpaxu6j9GE VVjcP7Qi6EjNuIX91/uL =vMMf -----END PGP SIGNATURE----- --Apple-Mail=_12E2BA9E-8637-40FA-B050-3BB9DBE86DB4--