Can we load Excel (.xlsx or .xls) file directly to Vertica Table?

Currently to load Excel (.xlsx or .xls) file to my Vertica Table I have to convert Excel file to CSV and then load it to Vertica Table using Copy query.

Is there any way that i can be able to load Excel (.xlsx or .xls) directly to Vertica without converting it to CSV?

Any kind of help will be appreciated.


  • Jim_KnicelyJim_Knicely - Select Field - Administrator

    Yes, you have to convert them.

    I use xlsx2csv to convert Excel files to CSV in Linux.



    [root@s18384357 dbadmin]# easy_install xlsx2csv
    Searching for xlsx2csv
    Best match: xlsx2csv 0.7.4
    Processing xlsx2csv-0.7.4.tar.gz
    Writing /tmp/easy_install-CnIxQW/xlsx2csv-0.7.4/setup.cfg
    Running xlsx2csv-0.7.4/ -q bdist_egg --dist-dir /tmp/easy_install-CnIxQW/xlsx2csv-0.7.4/egg-dist-tmp-pbf5cn
    zip_safe flag not set; analyzing archive contents...
    Moving xlsx2csv-0.7.4-py2.7.egg to /usr/local/lib/python2.7/site-packages
    Adding xlsx2csv 0.7.4 to easy-install.pth file
    Installing xlsx2csv script to /usr/local/bin
    Installed /usr/local/lib/python2.7/site-packages/xlsx2csv-0.7.4-py2.7.egg
    Processing dependencies for xlsx2csv
    Finished processing dependencies for xlsx2csv
    [root@s18384357 dbadmin]# exit
    [dbadmin@s18384357 ~]$ file ExcelFile.xlsx
    ExcelFile.xlsx: Microsoft Excel 2007+
    [dbadmin@s18384357 ~]$ xlsx2csv ExcelFile.xlsx ExcelFile.csv
    [dbadmin@s18384357 ~]$ cat ExcelFile.csv
    [dbadmin@s18384357 ~]$ xlsx2csv ExcelFile.xlsx ExcelFile.csv; cat ExcelFile.csv | vsql -c "COPY test FROM stdin SKIP 1 DELIMITER ',';"
    [dbadmin@s18384357 ~]$ vsql -c "SELECT * FROM test;"
    col1 | col2 |        col3
        1 | ABC  | 2012-09-19 00:00:00
        2 | XYZ  | 2012-05-04 00:00:00
    (2 rows)
  • edited March 2019

    I am using openpyxl to convert .xlsx to csv and pyexcel to convert .xls to pyexcel

    What are your reviews about both these packages?

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file