Web page table to Calc, bad format for RGB numbers

web page table number format.ods

Hello, I tried to copy paste a web page table from the link below to Calc in 7.0

https://hig.kde.org/style/color/default.html

Sadly, as seen in the attached document, some of the RGB values which are simply 3 digits separated by comma looses the comma. In effect, the meaningful RGB value becomes a useless 8 or 9 digit number. I am wondering whether we can get the paste the same as in web page because it is just 3 numbers with comma in between. Any help will be great. Thanks.

PS : Interestingly, it works fine in Writer 7.0

The input parser sees 123,456,789 as a number with thousand separators (even if the comma is not in “thousand position”. It is removed to get the arithmetic value of this single number. During the paste operation, try a locale for which the thousand separator is not a comma.

It works in Writer because basically tables in Writer contain uninterpreted text (number recognition not enabled).

Thanks. I tried English US and English India, without success. Can you please suggest a locale that does not remove the comma ?

German (Germany)

Works perfect. Thanks. :slight_smile:

A sequence like 123,456,789 in an English language variant is read as “123 millions 456 thousands 789 units” because the comma is a thousand separator.

When you paste such a sequence into a Calc cell, a parser translates this text into a number, ignoring any comma, even if not in a thousand position. This explains why the RGB triplet ends up as a single number.

For the sequence to be considered as text, the comma must not have this separator culture-specific role. The best way to do it is to switch to another locale where the comma has no specific role (neither as a thousand separator nor as a decimal “point”).

If you paste in a single cell, the best way is to change the language attribute of the cell Format>Cells. Unfortunately, there is no [None] choice like in Writer. I suggest to choose Chinese to be sure. You can keep this attribute in case you want to modify the content, it does not hurt as long as you don’t enter Chinese data. You can also revert to your default locale once entered.

As you seem to paste a whole table, the position of the “offending” cells is not predictable. Then temporarily switch to another locale. @PKG suggested German but the comma is the decimal separator. I am not sure that this will not interfere with the paste operation (e.g. in case R or B value is missing as in 123,456). Prefer a more alien locale like Chinese. It does not really matter because you will restore your locale after the paste operation.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

When I tried, using German ( Germany ) worked. Thanks to both of you for the help.