Skip to contentSkip to conversation

Commas used as decimal mark in CSV output

Powertop Valentin Lorentz 2 participants 2 messages Apr 12, 2016 – Apr 26, 2016

lore
Share & tools
lore

Valentin Lorentz

author
#0 lore raw

Hi,

Some locales use a comma instead of a dot as a decimal mark (ie. separator between integer and fractional parts of a number).

When powertop is run with such a locale, numbers in the CSV output will contain a comma; which breaks CSV parsing, because commas are also separators for the CSV fields.

You can reproduce this with the following command (assuming French locales are installed on your system):

# LANG=fr_FR.UTF-8 powertop --time=1 --csv=/tmp/powertop.csv

Example of what one gets when running this command:

Usage,Device Name
26,7%,CPU misc
26,7%,DRAM
26,7%,CPU core
90,2 ops/s,GPU misc

Regards,
Valentin

#1 lore raw

Hi Valentin,

Thanks for the bug report. If you'd like to post it on our Bugzilla (that helps us and the greater community), feel free to do so here:

https://app.devzing.com/powertopbugs/bugzilla

Cheers, hth

Quoted 36 lines · Valentin Lorentz

Hi,

Some locales use a comma instead of a dot as a decimal mark (ie. separator between integer and fractional parts of a number).

When powertop is run with such a locale, numbers in the CSV output will contain a comma; which breaks CSV parsing, because commas are also separators for the CSV fields.

You can reproduce this with the following command (assuming French locales are installed on your system):

# LANG=fr_FR.UTF-8 powertop --time=1 --csv=/tmp/powertop.csv

Example of what one gets when running this command:

Usage,Device Name
26,7%,CPU misc
26,7%,DRAM
26,7%,CPU core
90,2 ops/s,GPU misc

Regards,
Valentin

_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertop