开发者社区 问答 正文

在Unix / Linux上将Access数据库转换成定界格式

我有一个Access数据库文件,我需要将其转换为定界文件格式。Access DB文件具有多个表,我需要为每个表创建单独的定界文件。

到目前为止,我无法使用任何Unix命令来解析Access DB文件。有什么办法可以在Unix上执行此操作吗?

展开
收起
祖安文状元 2020-01-08 15:38:01 708 分享 版权
1 条回答
写回答
取消 提交回答
  • 您可以使用UCanAccess通过控制台实用程序将Access表转储为CSV文件:

    gord@xubuntu64-nbk1:~/Downloads/UCanAccess$ ./console.sh
    /home/gord/Downloads/UCanAccess
    Please, enter the full path to the access file (.mdb or .accdb): /home/gord/ClientData.accdb
    Loaded Tables:
    Clients
    Loaded Queries:
    
    Loaded Procedures:
    
    Loaded Indexes:
    Primary Key  on Clients Columns: (ID) 
    
    UCanAccess>
    Copyright (c) 2019 Marco Amadei
    UCanAccess version 4.0.4
    You are connected!! 
    Type quit to exit 
    
    Commands end with ; 
    
    Use:   
       export [--help] [--bom] [-d <delimiter>] [-t <table>] [--big_query_schema <pathToSchemaFile>] [--newlines] <pathToCsv>;
    for exporting the result set from the last executed query or a specific table into a .csv file
    
    UCanAccess>export -d , -t Clients clientdata.csv;
    UCanAccess>Created CSV file: /home/gord/Downloads/UCanAccess/clientdata.csv
    
    UCanAccess>quit
    Cheers! Thank you for using the UCanAccess JDBC Driver.
    gord@xubuntu64-nbk1:~/Downloads/UCanAccess$
    gord@xubuntu64-nbk1:~/Downloads/UCanAccess$ cat clientdata.csv 
    ID,LastName,FirstName,DOB
    1,Thompson,Gord,2017-04-01 07:06:27
    2,Loblaw,Bob,1966-09-12 16:03:00
    
    2020-01-08 15:38:08
    赞同 展开评论