DBFADD(1)
π dbfadd(1) β the shplib girly β¨
okay so bestie, we're in the shplib zone and today's main character is dbfadd, a lil command that adds a row to an xBase DBF file. yes. that's the whole job. she's simple, she's iconic, she's exactly what we need. π¦
β¨ NAME β¨
dbfadd β adds a row to an xBase DBF file. that's it, that's her. slay. π
π SYNOPSIS π
dbfadd xbase_file field_values...
π DESCRIPTION π
So the way this works: dbfadd adds a row to the DBF file whose name you give in xbase_file, and the column values come from the field_values options that follow it. π
and here's the lil quirky thing β a NULL value? that's just an empty argument. nothing in there. ghost. invisible. but real, bestie. π
πΈ OPTIONS πΈ
xbase_fileβ the name of an existing xBase file. like, it has to already exist, ok? we're not creating anything here, we're just adding to the vibe. β¨field_valuesβ the list of values you want shoved into the xBase file. π and there is a rule here: you MUST give exactly as many values as the xBase file has fields. no more, no less. and the order of your values has to match the order of the fields inside the xBase file too. it's giving "match my energy, in order, precisely." periodt. π₯
π EXAMPLE π
dbfadd testbase.dbf REGION1 25.656 150.22
So let's say testbase.dbf has 3 fields, namely NAME, AREA and VALUE. Then this command line inserts a brand new record into testbase.dbf, with:
"REGION1"for theNAMEfield'25.656'for theAREAfield'150.22'for theVALUEfield
three fields, three values, all lined up like a cute lil choreography. π©°β¨
π«Ά EXIT STATUS π«Ά
0β successful program execution. she ate and left no crumbs. π1β you're missing thexbase_fileorfield_valuesarguments. oops. π2β failed to openxbase_filefor reading and appending. π3β too few values infield_values... like, the count did not count. π
π DIAGNOSTICS π
these are the diagnostics that may be issued on stdout:
DBFOpen(xbase_file,"rb+") failed.
Got count1 fields, but require count2
π AUTHOR π
dbfcreate is part of shapelib, maintained by Frank Warmerdam. This guide was created by Eduardo Patoo Kanegae and converted to manpage by Johan Van de Wauw. It was further enhanced with the man page written by Joonas Pihlaja (jpihlaja@cc.helsinki.fi).
shoutout to the whole group chat of people who made this exist, fr fr. π«Άβ¨
π BUGS π
okay so listen up because this one actually matters:
- Field values that are too large to fit in a field are silently truncated from the right. like, gone. no warning, no drama, just βοΈ. bestie, be careful.
- Numeric field values that can't be parsed by
atof(3)get undefined values. undefined. we don't know what they'll be. nobody knows. it's a mystery. do not rely on it. π
π¦ SEE ALSO π¦
dbfcat(1), dbfcreate(1), dbfdump(1), dbfinfo(1), shpadd(1), shpcat(1), shpcentrd(1), shpcreate(1), shpdump(1), shpdxf(1), shpfix(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1)
like the whole plushie collection, go collect them all. π§π
and that's the tea, bestie! this lil gem is straight out of shplib, dated March 2026 β so when you're adding rows to your DBF files, remember: match the field count, match the order, and may your values always fit. mwah. ππβ
π¦ where this page comes from
- ubuntu stonking: shapelib 1.6.3-1 Β· MIT OR LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms