EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: EPICS database comparison
From: John Faucett <[email protected]>
To: [email protected]
Date: Thu, 10 Dec 2009 15:06:59 -0700
Title: Re: EPICS database comparison
The script below sorts record definition blocks, but not the fields within a record.  The "record" header must begin in column 1 and the record's closing bracket must be the last non-whitespace character on the line.

#!/usr/local/bin/perl
# File: recordSort
# Purpose: Sort an EPICS .db file by record name.
# Usage: recordSort <file>

$name = '!';
$block = '';
while( <>) {
  if ( /^record.*"(.*)"/) {
    $name = $1;
    $block = $_;
  }
  else {
    $block .= $_;
    if ( /\}\s*$/) {
      $block{ $name} = $block;
      undef $block;
    }
  }
}

foreach $name ( sort keys %block) { print $block{ $name};}

# EOF


References:
EPICS database comparison Pam Gurd

Navigate by Date:
Prev: Re: EPICS database comparison Andrew Johnson
Next: Reading an array of strings from a Waveform record Simon Hoyle
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: EPICS database comparison Andrew Johnson
Next: Reading an array of strings from a Waveform record Simon Hoyle
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·