Bug when reading Table saved with Tab?

Hi,

When I open a Table saved with Tab as delimiter the macro function Table.getResult will always give me a NaN or null result. When the delimiter is changed to , , I get the correct results.

Any help appreciated.

Best,

Thomas

Does your tabbed text file have the extension .csv? I get three columns containing 11, 2 and 3 when such a file contains 11\t2\t3, where \t indicates a tab.
Here is a file (6 Bytes) you can use to test. Open using File > Open.

Hi @eljonco,

I have problem with these two csv files : test.csv (29.6 KB) and test3Dmanager.csv (32.9 KB)

You can try this macro :

Table.open("/home/thomas/test.csv");
a = Table.getString("Label", 0);
b = Table.get("Moment1",0);
print(a,b);

Table.open("/home/thomas/test3Dmanager.csv");
a = Table.getString("Label", 0);
b = Table.get("Moment1",0);
print(a,b);

I will get this result :
Screenshot_20200513_155602

Best,

Thomas

Hi @ThomasBoudier,
I’m not sure it’s a bug.
I just tested in Jython, if you rename test3Dmanager.csv to a tsv extension it works as expected.
Probably the reader relies on the extension to decide on the separator.

Strangely dragging the csv on the Fiji file opens it correctly, eventhough it is a tab-separated, maybe someone took care of that for the drag and dropping.

Hi @LThomas,

Thanks for your help, actually the files opens fine, but the reading from a macro does not seem to read the values correctly.

Best

Thomas

Table.open("C:\\Users\\Laurent Thomas\\Downloads\\test3Dmanager.tsv");
a = Table.getString("Label", 0);
b = Table.get("Moment1",0);
print(a,b);

This works for me in with the macro language, with both files.
Maybe update the ImageJ core ?

The table shows up anyway right ?

It may print OK, but it may not calculate OK, I guess. Because it is a NaN?
See this thread on recognising and pulling out numbers from strings, considered NaNs too…