https://bugs.documentfoundation.org/show_bug.cgi?id=100899
tagezi <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEEDINFO
CC| |[email protected]
Ever confirmed|0 |1
OS|Windows (All) |All
Severity|normal |enhancement
--- Comment #5 from tagezi <[email protected]> ---
(In reply to Александр Бодров from comment #0)
> Created attachment 126198 [details]
> Libreoffice langolier zero
>
> Сделайте уже ради бога корректное открытие файлов CSV. Им сейчас пользуются
> в основном только для импорта данных из баз данных (в моем случае
> интернет-магазина), где есть артикулы, штрих-коды и прочие цифры, которые
> начинаются с НУЛЯ. LibreOffice по-умолчанию их убирает, это делает тип
> данных "СТАНДАРТ".
> Разве может быть нормальным то, что ваша программа искажает данные, которые
> открывает?
> Может сделаете фикс, хак, настройку, да что угодно чтобы данные открывались
> как тип "ТЕКСТ"?
This problem can not be resolved trivial.
Firstly, there are engineering programs and methods of number storage in
databases of when leading zeros are preferred, but a field in the CSV can not
recognize they as a text.
On the other hand, there are phone numbers and bar codes in which the symbol of
zero as the first symbol may be used.
The standard (in fact there is no standard, there are recommendations) does not
give clear guidance how to recognize a text field in a CSV file.
But there is a rule for the use of a separator in the text field that can be
extended to any a text field without any complications to read the file.
If a separator is found inside a text field, this field must be enclosed in
quotes.
Thus the problem of recognition of the text fields can be solved.
There are four ways to solve this problem.
1. The first way you shown in the attachment.
2. The second way, all fields to enclose in quotes when you export from the
database.
3. The third way, suggest the improvement for the enhancement of special
numbers for the import the field with a leading zero as text.
4. The fourth way to create a import macro that will automatically result in
all the fields in the text format.
Automatic detection into all cases of fields with leading zeros as text is
harmful, and we will get the bug reports that will ask us to correct it.
But there is another problem. Calc can display leading zeroes in numbers and
export these leading zeros in the CSV file. But when importation occurs back,
he did not recreates format with leading zeros. But this again is an
enhancement, but not a bug.
I put the "for all operating systems" because it does not depend on the system,
"enhancement" because it is improvement, and NEEDINFO because it requires
clarification that a developer will improve.
--
You are receiving this mail because:
You are the assignee for the bug._______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs