Created
July 8, 2021 20:51
-
-
Save cviniciussn/ea6ca378840f272f849a09359d01449f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Dbf } from 'dbf-reader'; | |
import { Column, DataTable } from 'dbf-reader/models/dbf-file'; | |
import * as fs from 'fs'; | |
let buffer:Buffer = fs.readFileSync('/home/vini-ubnt/Documentos/HNSA/FUSMA.dbf') | |
let datatable:DataTable = Dbf.read(buffer) | |
if(datatable){ | |
datatable.rows.forEach((row: any) => { | |
datatable.columns.forEach((collum: Column) => { | |
console.log(row[collum.name]) | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/home/vini-ubnt/Documentos/CODING/MISC/Read_DBF/reading_dbf.ts:1
import { Dbf } from 'dbf-reader';
^
SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)