How to create .dbf file
Hey guys,
I need to create a .dbf file,
How can I create this type of file?
There is some lib or plugin to do that?
Product version: Caché 2018.1
$ZV: Cache for UNIX (Red Hat Enterprise Linux for x86-64) 2018.1.5
Hey guys,
I need to create a .dbf file,
How can I create this type of file?
There is some lib or plugin to do that?
Are there really no other options (CSV, JSON, XML)?
I have some code for a DBF reader, if you're interested I can share it and you can create a DBF writer by analogue.
unfortunately no, I really need to export a .dbf file
If there is no problem, it would be great to see this code.
Well, enjoy.
UPD: it was missing isc.util.dbf.Field.
Class isc.util.DBF.Field Extends %SerialObject [ ClassType = serial, ProcedureBlock ] { Property name As %String(TRUNCATE = 1); Property type As %String(TRUNCATE = 1); Property length As %Integer; Property decimals As %Integer; }
I just found this. https://stackoverflow.com/questions/3897694/python-convert-csv-to-dbf
(just 1 of several dozens)
You have no embedded Py in Caché. But you could create a CSV
and then convert it to DBF with an external converter triggered by some $ZF(-1) Or via CPIPE device.
You can try using DBF utility from my old Cache-based framework:
https://github.com/logist/p6/blob/master/classes/p6/Dbf.xml
It has ReadFile/ReadStream & WriteFile/WriteStream methods
Usage:
data format $list(var1,...,varN)