Class ChangeInfo, purpose of Method getComponentType()

Hi,

what info exactly is this supposed to provide?

I’m struggling to write code that compares two csv files and accesses the names and values of the
fields (of the entries that have been changed), so that the result of the comparison can be written into a json file.

So is it possible to access names and values with getComponentType()? thanks

hi @sbusch ,
Thank you for reaching out!

To clarify: the ComponentType field returns the internal node type name ("Run", "Cell", "Paragraph", etc.) — it describes what kind of element was changed.

Currently, there is no built-in way to retrieve the column name or cell position when comparing CSV files. However, if it works for you, we can add the following properties to ChangeInfo in one of the upcoming releases:

  • Row — row index
  • Column — column index
  • ColumnHeader— column name taken from the first row of the worksheet

This would allow you to easily build a JSON output with field names and values.

Would this solution work for you?

Thanks @alexndr, that would be helpful.
For now, my solution is to use a BufferedReader on the csv, turning its lines into seperate strings, then splitting each of these strings by the commata in the line.
So I can create an object from each line and turn each splinter of the String into values of this object’s fields and name the fields according to the csv’s header line.

1 Like

hi @sbusch ,
Thank you for confirming!

We have created an internal ticket COMPARISONNET-4767 to track this enhancement.
We will notify you as soon as a release containing this feature is published.

One quick clarification, could you please confirm whether you are using the GroupDocs.Comparison for Java library? The implementation is first done in the .NET version, and then propagated to the other language ports (Java, Python, etc.), so knowing your target platform helps us let you know when the corresponding release for your library is available.

Yes, I was trying to use the Java version, which will most likely be the case for future tasks, too.

1 Like

Hi,
Thank you for the clarification.

1 Like

Hi,

Good news — this improvement has already been implemented (26.5).

To clarify: the ComponentType field returns the internal node type name ("Run", "Cell", "Paragraph", etc.) — it describes what kind of element was changed.

Previously, there was no built-in way to retrieve the column name or cell position when comparing CSV files. We have now added the following properties to ChangeInfo:

  • Row — row index
  • Column — column index
  • ColumnHeader — column name taken from the first row of the worksheet

This allows you to easily build a JSON output with field names and values.

The change will be available in one of the upcoming releases. We’ll notify you once it is published.

Best regards.

1 Like