Find the answer to your Linux question:
Results 1 to 7 of 7
Hi I have a .csv file, how do I save it like .xls file using a python script? It doesn't work if I just change the extention. Can anyone help ...
  1. #1
    Just Joined!
    Join Date
    Jun 2010
    Posts
    3

    Unhappy python script .xls file

    Hi
    I have a .csv file, how do I save it like .xls file using a python script?
    It doesn't work if I just change the extention.

    Can anyone help me?
    Thx

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,096
    What is the purpose?
    Calc/Excel can read or import csv files directly.
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Jun 2010
    Posts
    3

    Exclamation python script .xls

    I have to make 2 python scripts: one to make a .csv file (interogating a database- this is done) and one to make an excel file from this .csv file.
    This will be used on a web interface (using django) to make 2 butons for a database:
    1: save as .csv file
    2. save as .xls file

    My job is to do this script.

    Thx for your help

  4. #4
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    xls is a binary proprietary format, and I don't think it will be a simple task to create a file of that type

    here is a paid application SpreadScript: Use Perl, Python, or Tcl to Read and Write Microsoft Excel Spreadsheets on Linux and Solaris

    I think you will need to do some heavy googling like "create xls linux" "create xls without excel" "create xls python" etc

  5. #5
    Linux Newbie
    Join Date
    Sep 2004
    Location
    UK
    Posts
    160
    Probably not what you have time for, but you could try openoffice running as a server process and Python bindings for UNO (see OpenOffice.org Developer's Guide - OpenOffice.org Wiki) - never tried it my self (have played with the java bindings).
    In a world without walls and fences, who needs Windows and Gates?

  6. #6
    Just Joined!
    Join Date
    Jun 2010
    Posts
    3

    Cool

    thx for u're help
    I've managed to rezolv it, the long way:
    1)save datas as .csv
    2)covert from .csv to .xls
    3)delete the .csv file

  7. #7
    Linux Enthusiast Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    717
    and how did you do the conversion?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...