We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question
0

Web page table to Calc, bad format for RGB numbers [closed]

asked 2020-11-04 05:59:58 +0200

meetdilip gravatar image

updated 2021-05-23 00:54:07 +0200

Alex Kemp gravatar image

C:\fakepath\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/defau...

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

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2021-05-23 00:54:47.713235

Comments

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).

ajlittoz gravatar imageajlittoz ( 2020-11-04 07:50:43 +0200 )edit

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

meetdilip gravatar imagemeetdilip ( 2020-11-04 08:13:26 +0200 )edit

German (Germany)

PKG gravatar imagePKG ( 2020-11-04 09:06:03 +0200 )edit

Works perfect. Thanks. :)

meetdilip gravatar imagemeetdilip ( 2020-11-04 09:26:45 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2020-11-04 10:00:21 +0200

ajlittoz gravatar image

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.

edit flag offensive delete link more

Comments

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

meetdilip gravatar imagemeetdilip ( 2020-11-04 11:35:52 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2020-11-04 05:59:58 +0200

Seen: 51 times

Last updated: Nov 04 '20