When producing output for Excel, consider Spreadsheet::WriteExcel. I've produced CSV / TSV files for a long time, but Spreadsheet::WriteExcel makes it convenient to produce real Excel files instead.
| [reply] |
The Perl itself doesn't modify numbers. It can happens when third party programm reinterprets csv file. You can try to print ' character before a number to force Excel read it as text value. | [reply] |
As the others have said, it's not that your value in the CSV file is "wrong"; rather it is that Excel is choosing to apply its own formatting to the cell in which you want it to put the value 200802251655. ( OK, I am making an assumption here about your situation.)
I had a situation where I was doing a very similar thing, and my consumers (who were picking up the CSV file in Internet Explorer) were reporting this problem. They did not want to have to go into Excel's "Format Cell..." dialogue. Eventually I changed the format of the generated date/timestamp in the CSV file to "2008-02-25 16:55" (complete with the quotes) , Excel was happy, users were happy, I was happy ;-)
This signature will be ready by Christmas
| [reply] [d/l] |
>perl -le"$time_date=200802251655; print STDOUT $time_date;"
200802251655
I can't reproduce your results. Please provide more info.
| [reply] [d/l] |
additionally to the other answers: if we are talking about excel/openoffice here, in the import-dialogue you can choose the type of the fields, so here you'd have to choose Text'. | [reply] |