Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read Floating Point vairable #124

Open
landreww opened this issue Apr 19, 2024 · 0 comments
Open

Cannot read Floating Point vairable #124

landreww opened this issue Apr 19, 2024 · 0 comments

Comments

@landreww
Copy link

Receiving error trying to read dbf. The script is failing trying to read floating point fields.
Thanks for your help.

Here is the script:

<?php

require_once $_SERVER['MY_ROOT_DIR'] . '/vendor/autoload.php';
use XBase\TableReader;

$db = "D:\laragon\webdata\downloads\COUNTIES\Osceola\OsceolaTaxParcels.dbf";
$table = new TableReader($db);

while ($record = $table->nextRecord()) {
    //echo $record->get('my_column');
    //or
    echo $record->my_column;
}

Here are the columns:
parcelid (C 50)systemendd (D 8)area (F 19)perimeter (F 19)last_edite (D 8)simcondivt (C 50)pin (C 18)strap (C 65)dsp_strap (C 23)sec (C 2)twnshp (C 2)range (C 12)sub (C 12)blk (C 12)lot (C 12)subname (C 75)streetnumb (C 50)streetpfx (C 50)streetname (C 50)streetsfx (C 50)streetsfxd (C 50)loccity (C 50)loczip (C 10)condounit (C 50)condocompl (C 50)owner1 (C 75)owner2 (C 75)owner3 (C 75)billingadd (C 50)billinga_1 (C 50)billinga_2 (C 50)city (C 50)state (C 50)zip (C 50)country (C 50)zone1 (C 12)census (C 12)dorcode (C 4)dordesc (C 50)yearbuilt (N 5)effyr (N 5)totalacres (N 11)grossbldar (N 16)bldcode (C 4)buildtype (C 50)bldcode2 (C 4)buildtype2 (C 50)bldcode3 (C 4)buildtype3 (C 50)finarea (N 16)numofbuild (N 16)storyheigh (N 5)livunits (N 5)bedrooms (N 5)fullbaths (N 5)halfbaths (N 5)otherfixtu (N 5)kitchens (N 5)fireplaces (N 5)heattype (C 50)basementar (N 16)finbasemen (N 16)rooftype (C 50)roofcover (C 50)extwall (C 50)intwall (C 50)attachedga (N 16)detachedga (C 12)pool (N 10)frame (C 50)floor (C 50)baseyear (N 5)grade (C 12)quality (C 50)orbkpg (C 50)saledate (D 8)saleprice (N 16)nal (C 100)nalcode (C 4)q_u (C 1)grantor (C 60)stamps (N 19)soldasvaca (N 5)instrument (C 12)prevorbkpg (C 50)prevsaleda (D 8)prevsalepr (N 16)prevnal (C 100)prevnalcod (C 4)prevq_u (C 1)prevgranto (C 60)prevstamps (N 19)prevsoldas (N 5)previnstr (C 12)legaldescs (C 150)jurisdicti (C 4)jurisdesc (C 50)buildfacto (N 13)land1dor (C 4)land1dorde (C 50)land1units (N 19)land1ff (N 19)land1depth (N 19)land1unitt (C 4)land1uni_1 (C 12)land1ubpri (N 19)land2dor (C 4)land2dorde (C 50)land2units (N 19)land2ff (N 19)land2depth (N 19)land2unitt (C 4)land2uni_1 (C 12)land2ubpri (N 19)land3dor (C 4)land3dorde (C 50)land3units (N 19)land3ff (N 19)land3depth (N 19)land3unitt (C 4)land3uni_1 (C 12)land3ubpri (N 19)xfob1type (C 4)xfob1desc (C 12)xfob1size (C 50)xfob1year (N 10)xfob2type (C 4)xfob2desc (C 12)xfob2size (C 50)xfob2year (N 10)xfob3type (C 4)xfob3desc (C 12)xfob3size (C 50)xfob3year (N 10)comment (C 254)exemptions (C 25)exemption1 (C 4)exemptio_1 (C 50)exemptio_2 (N 10)exemption2 (C 4)exemptio_3 (C 50)exemptio_4 (N 10)exemption3 (C 4)exemptio_5 (C 50)exemptio_6 (N 10)assessedva (N 10)currland (N 10)curragcred (N 10)currbldg (N 10)currxfob (N 10)currjust (N 10)currexempt (N 10)estimatedt (N 10)latestprev (N 5)rolltype (C 4)prevfullla (N 10)prevagcred (N 10)prevlandle (N 10)prevbldg (N 10)prevxfob (N 10)prevassess (N 10)prevexempt (N 10)prevtaxabl (N 10)distgroup (C 4)numofunits (N 5)lastupdate (D 8)cra (C 50)

Here is the error:

[19-Apr-2024 17:03:46 UTC] PHP Fatal error:  Uncaught XBase\Exception\InvalidColumnException: Cannot find Field for `F` data type in D:\laragon\vendor\hisamu\php-xbase\src\DataConverter\Record\DBaseDataConverter.php:92
Stack trace:
#0 D:\laragon\vendor\hisamu\php-xbase\src\DataConverter\Record\DBaseDataConverter.php(102): XBase\DataConverter\Record\DBaseDataConverter->findFieldConverter(Object(XBase\Header\Column))
#1 D:\laragon\vendor\hisamu\php-xbase\src\DataConverter\Record\DBaseDataConverter.php(62): XBase\DataConverter\Record\DBaseDataConverter->normalizeField(Object(XBase\Header\Column), '  6.44169946289...')
#2 D:\laragon\vendor\hisamu\php-xbase\src\Record\RecordFactory.php(32): XBase\DataConverter\Record\DBaseDataConverter->fromBinaryString(' 35252748460001...')
#3 D:\laragon\vendor\hisamu\php-xbase\src\TableReader.php(154): XBase\Record\RecordFactory::create(Object(XBase\Table\Table), Object(XBase\DataConverter\Encoder\IconvEncoder), 0, ' 35252748460001...')
#4 D:\laragon\public_html\code\admin\dbf-test.php(9): XBase\TableReader->nextRecord()
# in D:\laragon\vendor\hisamu\php-xbase\src\DataConverter\Record\DBaseDataConverter.php on line 92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant