On Friday 30 April 2010 05:12:26 Luedeke Andreas wrote:
> Just be aware of a minor pitfall:
> if one of the fields does not exist for one of your records, it will be
> just missing in the output.
> E.g.
>
> dbl * "RTYP PREC EGU DTYP DESC"
>
> test:1,"bi","Soft Channel","desc of test:1"
> test:2,"calc","1","unit","","desc of test:2"
> test:3,"longout","unit","Soft Channel","desc of test:3"
>
> So if you want to parse the output, it's saver to generate extra files
> for each field that is not common to all records. (Note: 'calc' records
> have a DTYP field, it just happens to be always NIL)
(All record types must have a DTYP field, it's part of dbCommon.)
The first parameter to dbl is the record type (it doesn't actually support
wild-cards though, "*" or "" are special strings that are explicitly tested
for and mean all types), so to avoid the issue of missing fields you could
list each record type separately, giving the fields you're interested in for
that type:
dbl bi "RTYP ZRST ONST DTYP DESC" > bi-data.txt
dbl ai "RTYP PREC EGU DTYP DESC" > ai-data.txt
dbl calc "RTYP PREC EGU CALC DESC" > calc-data.txt
etc.
- Andrew
--
The best FOSS code is written to be read by other humans -- Harald Welte
- Replies:
- Re: Dump record fields into a text file Luedeke Andreas
- References:
- Dump record fields into a text file emmanuel_mayssat
- Re: Dump record fields into a text file Andrew Johnson
- Re: Dump record fields into a text file Luedeke Andreas
- Navigate by Date:
- Prev:
Re: Dump record fields into a text file Luedeke Andreas
- Next:
Re: Dump record fields into a text file Luedeke Andreas
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
<2010>
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: Dump record fields into a text file Luedeke Andreas
- Next:
Re: Dump record fields into a text file Luedeke Andreas
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
<2010>
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|