I analyzed the table comparison with the provided two CSV files modified and saved by me in several variants all with DOS/Windows instead of Unix line endings. I could not find out the reason for the empty phantom data columns. I created therefore an issue report as it can be read below and sent it by email to support of UltraEdit, Inc. The RAR archive file is not attached here to keep the data in the CSV files private.
Subject: UC - Empty phantom data columns on table comparing two CSV files
There is an issue with empty phantom data columns on comparing two CSV files with table comparison depending on the data with 64-bit UltraCompare Prof. 2024.1.0.5 as detected first by an UltraCompare user asking for help in the UltraCompare Text Compare and Merge forum, see (url of this topic).
The
(not here) attached RAR archive file CSV_comparison.rar contains several CSV files and screenshots for the explanation of this issue which I analyzed without finding out the reason.
There is executed a table comparison with a checked option
Ignore separators in quotes in
Current Session Properties dialog window as captured by me to the attached image CSV_comparison_properties.webp. This option must be checked on comparing the two CSV files File_Left_1.csv and File_Right_1.csv because of line 237 containing two additional commas in double quoted values in the data columns A and B. The line 237 has therefore in total 12 commas while all other lines have 10 commas and no double quoted field values. However, the line 237 is of no importance for the empty phantom data columns issue as it turned out with further tests.
There can be seen on image CSV_comparison_1.webp that there is on left side the data column E which does not contain any data in any row and on right side the data column H also not containing any data in any row. The reason for the two empty phantom data columns is unclear.
There was created by me the files File_Left_2.csv and File_Right_2.csv by deleting in both files all lines from the line 22 to the end of each file and saving both CSV files. In UltraCompare is replaced in both file names the number 1 by 2 and refreshed the table comparison. The result is captured to the image CSV_comparison_2.webp. The table comparison is now with the eleven data columns without any empty phantom columns.
I created next the files File_Left_3.csv and File_Right_3.csv by keeping from File_Left_1.csv and File_Right_1.csv the first 22 lines, deleting in both files all lines from the line 23 to end of each file and saving both CSV files. In UltraCompare is replaced in both file names the number 2 by 3 and refreshed the table comparison. The result is captured to the image CSV_comparison_3.webp. The table comparison is now again with empty phantom columns. There is again an empty phantom data column E on left side. On right side is now an empty phantom data column G instead of H as on comparing the CSV files File_Left_1.csv and File_Right_1.csv. This comparison behavior is again not understandable for me on looking on the 21 data rows in comparison to the former comparison with 20 data rows.
Does the issue occur always on having more than 20 data rows?
No, as I could find out with the next two CSV files comparisons.
The CSV files File_Left_4.csv and File_Right_4.csv were created by
- opening the two files File_Left_1.csv and File_Right_1.csv,
- deleting in both files all lines from line 22 to end of the file,
- selecting and copying the lines 2 to 21 (the 20 data rows),
- pasting the 20 lines twice at the end of each file,
- saving both CSV files as File_Left_4.csv and File_Right_4.csv.
The table comparison is fine in UltraCompare with File_Left_4.csv and File_Right_4.csv without phantom data columns, see the image file CSV_comparison_4.webp.
The CSV files File_Left_5.csv and File_Right_5.csv were created next by
- opening the two files File_Left_1.csv and File_Right_1.csv,
- deleting in both files the lines from line 22 to line 49,
- keeping line 50 (now line 22) and deleting all other lines below,
- saving both CSV files as File_Left_5.csv and File_Right_5.csv.
The table comparison is fine in UltraCompare with File_Left_5.csv and File_Right_5.csv without phantom data columns, see the image file CSV_comparison_5.webp.
Last were compared again in UltraCompare the files File_Left_1.csv and File_Right_1.csv with opening again the session properties, checking for both files the option
Use row 1 for column headers, and clicking on button
OK and Run. The image file CSV_comparison_header.webp shows that the two initial CSV files are compared now also without empty phantom data columns.
That is all very strange. I think, only an UltraCompare developer can find out with a debugger why there are empty phantom data columns on comparing File_Left_1.csv and File_Right_1.csv and File_Left_3.csv and File_Right_3.csv without checked options
Use row 1 for column headers and why there is a phantom data column H on comparing *_1.csv and a phantom data column G on comparing *_3.csv on right side with in both use cases a phantom data column E on left side.
The solution is at least for the CSV files in the attached RAR archive using the option
Use row 1 for column headers for both compared CSV files.