-1

I some textfield I wish to export to CVS without date conversion..

Example:

"1/1" is change to 01 Jan 2012 when I open the .cvs file with excel.

The current solution is to add a whitespace, may I know if there is any more elegant solution?

Bonus question: There is a API for exporting data to CVS? I find that setting the column using arrays very crude.

4
  • Here's a "Bonus Question" for you: What have you tried? Commented Aug 7, 2012 at 2:26
  • The current solution is to add a whitespace, Commented Aug 7, 2012 at 3:36
  • Try to prepend the number with a single quote "'1/1". I haven't tried it though. Commented Aug 7, 2012 at 4:21
  • Also, a short googling lead to this, stackoverflow.com/questions/7178145/… Why didn't you google first before asking? Commented Aug 7, 2012 at 4:24

1 Answer 1

0

This conversion is because of Excel not the CSV file. There are two solutions

  1. Use a library to export xls files
  2. Create a new Excel file in Excel and select whole sheet and change the type of cells to Text (or at least those column you think that should not be changed to date). Then you can import your csv file by copy and paste its content into the excel file and split the columns using the import wizard.
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.