[Xastir] dbfawk files on OSX

Tom Russo russo at bogodyn.org
Sat Mar 19 20:32:42 EST 2005


On Sat, Mar 19, 2005 at 03:31:47PM -0600, we recorded a bogon-computron collision of the <jdw at eng.uah.edu> flavor, containing:
> 
> >All if does is get the name of the NOMGEO field and put it in the name 
> >variable;
> 
> These are two different records, so the name variable will get reset 
> (by BEGIN_RECORD) between the NOMGEO record and the CONCIS record.  
> Here's what the sample dbfawk says:
> 
> ># BEGIN_RECORD is called once per dbf record which contains multiple 
> >fields.
> ># Use this rule to re-initialize variables between records.
> 

No, each dbf record contains both NOMGEO and CONCIS fields.  BEGIN_RECORD
only gets called once per record, not once per field in a record.  If the
dbfawk rules contained "skip" commands then it could go to the next record and
reset things, but that's not the case here.

If the copy of the dbfawk file attached to the original post is accurate, then
I think I see a problem:

BEGIN {
dbfinfo="NOMGEO:CLEBDTC:GENERIQUE:CONCIS:LATITUDE:LONGITUDE:REFERENCE: 
NUMEROSNRC
dbffields="NOMGEO:GENERIQUE:CONCIS"}

The dbfinfo variable value is not terminated with a double quote.  Not sure
*what* dbfawk does when it encounters such a thing --- perhaps its syntax
checking isn't that good.  It should read:

BEGIN {
dbfinfo="NOMGEO:CLEBDTC:GENERIQUE:CONCIS:LATITUDE:LONGITUDE:REFERENCE:NUMEROSNRC";
dbffields="NOMGEO:GENERIQUE:CONCIS"}
 
(i.e. there's a missing double quote and semicolon in what was in the original
post)

If that was a transcription error in the post, then your other suggestion may 
well be the issue:  CONCIS=(Zone.*) will only match if the CONCIS field begins 
with Zone.  If there's any possibility of other characters preceding "Zone"
then one must wildcard, e.g. /^CONCIS=[ ]*(Zone.*)$/ or even 
/^CONCIS=.*(Zone.*)$/

-- 
Tom Russo    KM5VY     SAR502  DM64ux         http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 
 "The only thing you can do easily is be wrong, and that's hardly
  worth the effort." -- Norton Juster



More information about the Xastir mailing list