dbf_reader 1.0.2 copy "dbf_reader: ^1.0.2" to clipboard
dbf_reader: ^1.0.2 copied to clipboard

DBF (dBase) file reader, stream data or load into memory list.

example/lib/main.dart

import 'package:translate_to_sqlite/dbf_to_sql.dart';

/// The main function of the program
Future<void> main(List<String> arguments) async {
  // The dBase file name
  String dbNameGroups = './Tcambio.dbf';

  // Mapping the table
  TableMapper groupMapper = TableMapper(
    tableName: "QUOTATION",
    columnMapper: {
      "MO_CODIGO": "code",
      "TC_FECHA": "date",
      "TC_COTIZ": "value",
    },
  );

  /// Creating the object to manage the transaltion
  DBFtoSQL dbfGroups =
      DBFtoSQL(fileName: dbNameGroups, tableMapper: groupMapper);

  final dbfsToTranslate = [
    dbfGroups,
  ];

  // Transalte it and store the data
  for (DBFtoSQL dbf in dbfsToTranslate) {
    DateTime start = DateTime.now();
    print("Creating table ${dbf.getTableName()}");
    dbf.createTable();
    print("Inserting data to ${dbf.getTableName()}");
    await dbf.insertInto();
    print("Data into ${dbf.getTableName()} inserted");
    DateTime end = DateTime.now();
    print("Excecution time: ${end.difference(start).inSeconds}s");
  }
}
3
likes
160
points
37
downloads

Publisher

unverified uploader

Weekly Downloads

DBF (dBase) file reader, stream data or load into memory list.

Repository (GitHub)
View/report issues

Documentation

API reference

Funding

Consider supporting this project:

www.buymeacoffee.com

License

BSD-3-Clause (license)

Dependencies

test

More

Packages that depend on dbf_reader