Search code examples
c#.netexcelexport-to-excel

How do I programmatically open a TSV file and save it as an XLSX file?


I would appreciate any pointers to documentation or API calls I can use.

Basically, I'm hoping there's some way to invoke Excel to make the conversion, although I haven't yet found any solutions that work for Excel 2010.

I am using the .NET framework.


Solution

  • Excel handles CSV files well and is the default editor for them on systems where the Excel install hasn't been customised. I use csv files in almost all cases where I need an Excel file and I work with some very non tech-savvy users!

    Converting a TSV to a CSV is trivial in comparison to converting to xlsx - one of the best libraries I have used for working with flat files is Generic Parser which can read and write files delimited by any character (amongst many other things)