X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com Subject: Re: [geda-user] Searching for refdes's having a specific attribute? To: geda-user AT delorie DOT com References: <568F9808 DOT 5040808 AT envinsci DOT co DOT uk> <568F9AA5 DOT 4070402 AT iee DOT org> From: "Matt Rhys-Roberts (matt DOT rhys-roberts AT envinsci DOT co DOT uk) [via geda-user AT delorie DOT com]" Organization: Envin Scientific Ltd. Message-ID: <568FB7F6.7040300@envinsci.co.uk> Date: Fri, 8 Jan 2016 13:21:58 +0000 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <568F9AA5.4070402@iee.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 Thanks Michael... Hmm, it'll be interesting. The number of lines between the refdes=xxx and OrderCode=yyy lines, varies in number and sequence. So outputting via grep would need a blanket number of pre-match context and post-match context lines to include. It'd be messy :) For now I'll just use grep to locate which .sch files contain the specific order code, then hop around the schematic in gschem using Attributes->FindSpecificText . Regards, Matt. On 08/01/16 11:16, M. J. Everitt (m DOT j DOT everitt AT iee DOT org) [via geda-user AT delorie DOT com] wrote: > Now this is where the power of the raw text file comes into play. I > suggest you look at 'grep' which is a standard text utility in linux, > and will allow you to filter your schematics. You will probably need > some context (-A/-B/-C) in your grep command to give you all the > important information, but you can then process this to give you your list. > > If you need some help, drop me a line. > > Best regards, > > Michael. > > On 08/01/16 11:05, Matt Rhys-Roberts (matt DOT rhys-roberts AT envinsci DOT co DOT uk) > [via geda-user AT delorie DOT com] wrote: >> 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. >> >> The search function would have to know how to navigate to and fro >> within each component's curly brackets in the .sch file, to find which >> component that attribute value belongs to. So I guess a perl script >> might already exist for this? >> >> Gattrib doesn't let me sort by column, which would have been useful >> for this. Maybe there's an obvious and easier way to do what I'm >> trying to do...