Excel Reader into String to Long Integer Node

Hi All,

I have a dataset which identifier can be either a String, Integer or Long Interger (below). The issue i’m having is that the Excel Reader node automatically reads Identifier as a String. When using a String to Integer node (Specifically Long Integer) it is unable to read the Long Integer and gives a “?” value. I wouldn’t mind keeping it as a String, but I am unable to join with other Long Integers in a separate dataset.

Any advice or help would be greatly appreciated.

Identifier:
1234 (Integer)
AB1234 (String)
123456789123456789123 (Long Integer)

Best,
Chris

Hi @McManO, welcome to the forum.

I think that the “long integer” in your example is too long for KNIME to handle.

As far as I can tell, long numbers in KNIME are stored as 64-bit values, and so the largest signed number that can be represented is (2^63-1) or 9,223,372,036,854,775,807.

Are all of your long integers this large?

Hi @elsamuel thanks for your help! Really appreciate it. To resolve I did in a If statement in the source data to create a additional column with only integers, see below. I’d still like an automatic solution as I would have to this If statement prior to every pull.

New Identifier Column (If Statement):
1234 (Integer)
1234 (Integer)
123456789123456789123 (Long Integer)

With the above the Excel Reader node was able to read my Long Integer as a Double. To get back to the original identifier I merge them later through the workflow. I’d like an automated solution if anyone has any.

Hello @McManO,

only difference I see after if statement is removed AB from second column. Is it correct to assume you would like to automate this? If so you can use Cell Splitter By Position node after you read file in KNIME (assumption is that you always have two letters before digits). Then you can use String To Number node to be able to perform joining.

Welcome to KNIME Community!

Br,
Ivan

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.