Bug 169570 - Data Provider Transformation Replace Null for 0 and empty fields
Summary: Data Provider Transformation Replace Null for 0 and empty fields
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
26.2.0.0 alpha0+ master
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on: 165619 169568
Blocks: Data-Provider 169572 169581 169596 169608 169609 169610 169612 169615
  Show dependency treegraph
 
Reported: 2025-11-20 11:42 UTC by Michael Otto
Modified: 2025-11-22 10:57 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
example CSV file 8 Col x 16 lines with 0 values and empty fields (151 bytes, text/csv)
2025-11-20 11:42 UTC, Michael Otto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Otto 2025-11-20 11:42:23 UTC
Created attachment 204142 [details]
example CSV file 8 Col x 16 lines with 0 values and empty fields

+++ This bug was initially created as a clone of Bug #169568 +++
+++ This bug was initially created as a clone of Bug #165619 +++

PRECONDITION:
new Calc spreadsheet, Data > Define Range 
(see e.g. Bug #169514 attachment DataRangeForDataProvider.ods)
https://bugs.documentfoundation.org/attachment.cgi?id=204066


PROBLEM DESCRIPTION:
Data > Data Provider
select Range, CSV, URL e.g. attached 5x3numbersN.csv 
Transformations: Replace Null [ADD]
Replace Null: Replace with: NUL, Column Index 1;2;3;4;5;6;7;8
Preview [Apply]: 
- 0 are not replaced (example lines 2 and 7 Col 4)
- empty fields are not replaced, depending on the position (see EXAMPLE: below)
same result if imported with [OK]


EXPECTED BEHAVIOR:
"Replaces null or missing data in the list of columns with the supplied text"


EXAMPLE:
5x3numbersN.csv example:
1							8
1		1	0				
1,4	2		4				
1,5		3	5				
1,6	4		6				
1,7		5	7				
1		1	0				
1,4	2		4				
1,5		3	5				
1,6	4		6				
1,7		5	7				
1,6	4		6				
1,7		5	7	2	6	4	1
							
1,7		5	7				
1,5	2	3	5				8

example result:
1	NUL	NUL	NUL	NUL	NUL	NUL	8
1	NUL	1	0	NUL	NUL	NUL	NUL
1,4	2	NUL	4	NUL	NUL	NUL	NUL
1,5	NUL	3	5	NUL	NUL	NUL	NUL
1,6	4	NUL	6	NUL	NUL	NUL	NUL
1,7	NUL	5	7	NUL	NUL	NUL	NUL
1	NUL	1	0	NUL	NUL	NUL	NUL
1,4	2	NUL	4	NUL	NUL	NUL	NUL
1,5	NUL	3	5	NUL	NUL	NUL	NUL
1,6	4	NUL	6	NUL	NUL	NUL	NUL
1,7	NUL	5	7	NUL	NUL	NUL	NUL
1,6	4	NUL	6	NUL	NUL	NUL	NUL
1,7	NUL	5	7	2	6	4	1
NUL	NUL	NUL	NUL				NUL
1,7	NUL	5	7				NUL
1,5	2	3	5				8

empty fields' replacement:
obviously the lines are processed and columns are recognized from bottom to top
--> empty columns shall be recognized (lines 16, 15, 14 Col 5, 6, 7)
--> consider also the case that the _last_ columns are empty in the last lines 
    or even the CSV is not rectangular



Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 480ef73deef62c458e5735cd496a1d74ef408ed8
CPU threads: 2; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: en-US
Calc: threaded
Comment 1 raal 2025-11-20 17:34:55 UTC
I can confirm with Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 177b3d2a88afb2dfd3e89025624d8bf62b36cda4
CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded