Nella vita ci vuole c**o
Chi mi conosce, sa che spesso certe situazioni vengono proprio a cercarmi...ho una lunga lista di esempi più o meno dolorosi/divertenti.
Oggi, anche se non ero io il diretto interessato, mi è capitata una cosa da cui il titolo...
Ero alle prese con due file CSV (per la cronaca, comma-separated values file), generati a run-time e dalla struttura pressocchè identica.
L'estensione .csv è tranquillamente gestibile ad esempio con Excel che però, mentre sul primo file non dava alcun tipo di problema, sul secondo mi presentava questo errore:
"E' stato rilevato che 'file2.csv' è un file SYLK, ma non è possibile caricarlo.Il file contiene errori oppure non è in formato SYLK. Scegliere OK per provare ad aprire il file in un formato differente"
Inutile dire che, premendo OK il file viene aperto correttamente... ma non bisogna accontentarsi!
Rapida ricerca e spunta fuori l'assurdo:
This problem occurs when you open a text file or CSV file and the first two characters of the file are the uppercase letters "I" and "D". For example, the text file may contain the following text:
ID, STATUS
123, open
456, closed
Inutile dire che il caso da me incontrato è proprio questo...
Ancora più sorprendente workaround:
To open your file in Excel, open the file in a text editor, and then insert an apostrophe at the beginning of the first line of text.
Cavolo.. non ci sarei mai arrivato!![Smile [:)]](/emoticons/emotion-1.gif)
fonte: http://support.microsoft.com/kb/323626/en-us