http://www.perlmonks.org?node_id=948676


in reply to CSV or HTML?

I ran the code with your output file and I didn't see any single quote before the numbers.

cat input_output.txt Word; count; Unique words;204; Total words;390; mean;1.91176470588235; + variance ;17.0069545059403; sigma;4.12394889710582 ; 45 a; 5 about; 1 acts; 1 all; 1 amid; 1 and; 13 as; 2 ...

Maybe I'm just confused about your problem? BTW, that output isn't any kind of valid CSV I've ever seen. The first line doesn't match any of the other lines.

Celebrate Intellectual Diversity

Replies are listed 'Best First'.
Re^2: CSV or HTML?
by jms53 (Monk) on Jan 19, 2012 at 07:10 UTC

    The first line is slightly different, it gives the column names and then all other data relevant. (not sure if that invalidates my output).

    I tweaked the code to print the variables as '$words{$word}', and then replaced the single quotes to nothing in OpenOffice which then gave correct formatting.

    I was just bizarre because previously, sorting Z-A gave me 918 coming before 16000.

    Thank you very much!