Configure External Tool Custom Report to Use .tsv?

Configure External Tool Custom Report to Use .tsv? philip remes  2022-09-19 16:10

I have an external tool configured according to the nice documentation in External Tools-2_1.pdf. The custom report has the Raw Times and Raw Intensities columns defined, which use comma delimited lists. It is more convenient to parse this report with tab delimiting, allowing to parse the Raw Times lists easily: the alternative I've found is to use regular expressions to tell the difference between the commas for columns and the commas in the Raw Times, and this is orders of magnitude slower than a simple line.Trim().Split('\t'). Therefore I'd like to request some way to specify the delimiting of these external reports, either in the files, or else in the custom report .skyr file itself.


Nick Shulman responded:  2022-09-20 14:19
There is no way to change the format of the report that is fed to an external tool.

Which language are you writing your tool in?

It is usually a good idea to use a library to parse CSV files, because it's tricky to get the parsing rules correct in all cases, especially when fields might contain newlines. (I don't think you're likely to have a newline in the middle of any of the fields that you are working with, but it's theoretically possible).
-- Nick
philip remes responded:  2022-09-20 14:39
I'm using C#. Can you recommend a good library to use?

Nick Shulman responded:  2022-09-20 14:44
The consensus seems to be that for C# you should use the class "TextFieldParser" in "Microsoft.VisualBasic.dll" which works fine in C# despite its name:

-- Nick
philip remes responded:  2022-09-20 15:07
That library works great! Very fast on the .csv files, very easy to use. I had tried this regex solution FYI, don't do this.