Skip navigation
Currently Being Moderated

converting excel to text file

Nov 9, 2010 8:20 AM

HI All -

 

 

I am uploading an excel file using coldfusion. Once the file has been uploaded, I  want to convert it to a text file. What I am trying to do now is once the file is  uploaded, I am reading the excel file and then writing the output to text file.  but the write method creates all junk in the text file.  What is the best way to do this?

 

Thanks

 
Replies
  • Currently Being Moderated
    Nov 9, 2010 8:21 AM   in reply to funandlearning333

    Are you in CF9? If so you can read in the data. Then you could write

    it out to a text file.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 9, 2010 8:28 AM   in reply to funandlearning333

    If you are on CF8 you may want to look into Ben Nadel's POI Utility:

    http://www.bennadel.com/projects/poi-utility.htm

     

    --Nathan

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 9, 2010 10:29 AM   in reply to funandlearning333

    funandlearning333 wrote:

     

    The problem is the html is getting written to the text file. How can I make sure, i get only the header and rows values

     

     

    Then don't put HTML into the output content?  Whatever you put into the "output" string variable via <cfsavecontent variable="output"> is going to be written to the file with the output="#output#" parameter.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 10, 2010 12:24 PM   in reply to funandlearning333

    The version of the POI libraries bundled with ColdFusion 8 do not support

    the OOXML (.xlsx) format. To read .xlsx files you need to use the latest

    version of POI, which you can find here: http://poi.apache.org/

     

    For info on using POI with JavaLoader see:

    http://cfsearching.blogspot.com/2008/08/how-to-install-poi-on-coldfusi on-8.html

     

    (Note: CF 9 supports .xlsx natively via cfspreadsheet.)

     

    --Nathan

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 12, 2010 10:38 AM   in reply to funandlearning333

    How are you saving it as Microsoft 2000-2003? The options I get in Excel

    2010 when I choose "File -> Save As" list "Excel 97-2003 Workbook (*.xls)"

    but no 2000-2003 options.

     

    --Nathan

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 12, 2010 11:11 AM   in reply to funandlearning333

    Can you open the files with Excel after downloading them? Are you sure they

    are Excel files and not .csv or some other format?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points