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 the NAME field
  • '25.656' for the AREA field
  • '150.22' for the VALUE field

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 the xbase_file or field_values arguments. oops. πŸ™ˆ
  • 2 β€” failed to open xbase_file for reading and appending. 😭
  • 3 β€” too few values in field_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