Export to GitHub

jquerycsvtotable - issue #4

Final column in CSV file is treated as text not number.


Posted on Dec 18, 2012 by Helpful Panda

Hello,

I have a CSV file that looks like this:

"Volume","Description","Size","Used" "lbu_vc01_vfi01_vol00","vFiler root","10","0" "lbu_vc01_vfi01_vol01","Infrastructure VMs","1410","66" "lbu_vc01_vfi01_vol02","VMware cluster","20","0" "lbu_vc02_vfi01_vol00","vFiler root","10","0"

The table that is produced by CSVTable looks like this:

<thead class=""><tr class=""><th class="">Volume</th><th class="">Description</th><th class="">Size</th><th class="">Used</th></tr></thead><tbody class=""><tr class=" odd"><td class="">lbu_vc01_vfi01_vol00</td><td class="">vFiler root</td><td class="">10</td><td class="">"0" </td></tr><tr class=" even"><td class="">lbu_vc01_vfi01_vol01</td><td class="">Infrastructure VMs</td><td class="">1410</td><td class="">"66" </td></tr><tr class=" odd"><td class="">lbu_vc01_vfi01_vol02</td><td class="">VMware cluster</td><td class="">20</td><td class="">"0" </td></tr><tr class=" even"><td class="">lbu_vc02_vfi01_vol00</td><td class="">vFiler root</td><td class="">10</td><td class="">"0"

As you can see the numbers in the final column are surrounded by quotation marks, whereas those in the preceding column are not. It looks like it is treating the final column as text rather than numbers.

What version of the product are you using? On what operating system? Firefox 16.0 on Windows 7

Thanks for any help you can offer.

Regards,

Mark

Comment #1

Posted on Jan 2, 2013 by Helpful Panda

Hello,

I've managed to fix this bug with the follow amendment to line 99 of the code:

< var lines = data.replace('\r','').split('\n');

var lines = data.replace(/\r/g,'').split('\n');

Regards,

Mark

Status: New

Labels:
Type-Defect Priority-Medium