Bug 131397 - When opening a CSV file in Calc IPs are mangled
Summary: When opening a CSV file in Calc IPs are mangled
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium trivial
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: CSV-Import
  Show dependency treegraph
 
Reported: 2020-03-18 09:09 UTC by naitsirch
Modified: 2020-11-28 13:28 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
A test file to reproduce the issue (269 bytes, text/csv)
2020-03-18 09:09 UTC, naitsirch
Details
The import wizard without specified column type (70.25 KB, image/png)
2020-03-18 09:10 UTC, naitsirch
Details
Screenshot of the mangled IPs (13.40 KB, image/png)
2020-03-18 09:11 UTC, naitsirch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description naitsirch 2020-03-18 09:09:38 UTC
Created attachment 158775 [details]
A test file to reproduce the issue

When I open a CSV file with Calc and the file contains columns where IPs are listed, some of the IPs are mangled and shown as integers and the others are shown correctly, if no column type is specified in the import wizard.

For example the IP "84.157.112.1" is displayed correctly, whereas the IP "84.157.123.122" is displayed as "84157123122".

It would be nice if this behaviour could be changed.

I'll attach two screenshot and an CSV file to reproduce the issue.
Comment 1 naitsirch 2020-03-18 09:10:32 UTC
Created attachment 158776 [details]
The import wizard without specified column type
Comment 2 naitsirch 2020-03-18 09:11:05 UTC
Created attachment 158777 [details]
Screenshot of the mangled IPs
Comment 3 himajin100000 2020-03-18 09:19:02 UTC
What is the thousand separator used in your locale?
Comment 4 naitsirch 2020-03-18 13:13:37 UTC
Okay, I understand your point. The thousand separator in my locale is "." and LibreOffice interpretes an IP as a high number if the right thousand groups always consist of three digits.

I suggest this solution for this special case:
If the thousand separator is "." and the value is a valid IP (consists of four thousand groups where each is >= 0 and <= 255) the value should be interpreted as a number (as it is know). Additionally in the format settings of the cell is defined that thousand separator should be used.

This way it is interpreted as a number and shown like a number and like an IP.

What do you think?
Comment 5 m_a_riosv 2020-03-18 21:40:05 UTC
(In reply to naitsirch from comment #4)
> Okay, I understand your point. The thousand separator in my locale is "."
,,,,
> of the cell is defined that thousand separator should be used.
> 
> This way it is interpreted as a number and shown like a number and like an
> IP.

I think it's really difficult to find someone to fix your proposal.
There are solutions on the import window to solve much of the special cases.
In this case select the column clicking in the head, and fix their type to text.
Comment 6 naitsirch 2020-03-23 22:50:24 UTC
You are right. Thank you anyway :-)