Author Topic: export feature on players tab  (Read 1959 times)

jodybingo

  • Hero Member
  • *****
  • Posts: 667
    • View Profile
    • Personal Web Site
export feature on players tab
« on: September 23, 2010, 09:42:10 PM »
HI Corey, I came across an issue that is not TD2 related but may have caused me some issues later on. When I exported my players results from the Players Tab, the .csv file created produced an error. Excel indicated that it was a "SYLK" file and could not be opened. A quick google search turned up the issue. When the first two characters of a csv file are "I" and "D" in capital letters excel thinks it is an SYLK file.
I have moved my columns around so that the first column is not the ID of the player and the error disappeared. To prevent others from possibly panicking could you either have TD2 export the "ID" characters in lowercase or prevent "ID" from being the first problem?
Jody

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: export feature on players tab
« Reply #1 on: September 24, 2010, 10:31:39 AM »
That's fascinating.  Here's the relevant Knowledge Base article: http://support.microsoft.com/kb/323626

I'll change the export to put the column headers in quotations.  Should fix it.  Thank you for the heads-up!

jodybingo

  • Hero Member
  • *****
  • Posts: 667
    • View Profile
    • Personal Web Site
Re: export feature on players tab
« Reply #2 on: September 24, 2010, 03:26:35 PM »
Just a note (because I am not a microsoft fanatic) the file opens without error in OpenOffice

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: export feature on players tab
« Reply #3 on: September 24, 2010, 03:56:41 PM »
Yeah, it's an Excel-specific thing, it appears.  The thing is, it's perfectly valid (and not a bad idea) to place quotations around each cell's data in a CSV file.  It's only necessary if the data contains a comma, because without the quotes the comma would confuse the column separation.  For efficiency's sake (and human legibility), the quotes are only used when necessary.  I've changed all of the export code to always use quotes for the first line of the file, thus eliminating the issue without affecting anything else.