We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Does XlsIO support TSV files?

Platform: WinForms |
Control: XlsIO

This article explains whether XlsIO supports TSV files.

Does XlsIO support TSV files?

XlsIO do support opening and saving of TSV files from the assembly version 14.1 onwards. XlsIO do not need string separator for opening TSV files.

Download Complete Sample

Download input files with data

The following C#/VB complete code snippet explains the support of TSV files by XlsIO

C#

using Syncfusion.XlsIO;
using System.IO;
using System.Reflection;
 
namespace XlsIO_Supports_TSV
{
    class Program
    {
        static void Main(string[] args)
        {
            using (ExcelEngine excelEngine = new ExcelEngine())
            {
                //Instantiate the excel application object.
                IApplication application = excelEngine.Excel;
 
                //The workbook is opened.
                IWorkbook workbook;
 
                //Open existing workbook with data entered
                Assembly assembly = typeof(Program).GetTypeInfo().Assembly;
                Stream fileStream = assembly.GetManifestResourceStream("XlsIO_Supports_TSV.Sample.xlsx");
 
                workbook = application.Workbooks.Open(fileStream, ExcelOpenType.Automatic);
 
                //The first worksheet object in the worksheets collection is accessed.
                IWorksheet worksheet = workbook.Worksheets[0];
 
                //Saving the workbook as TSV file
                Stream stream = File.Create("Output.tsv");
                workbook.SaveAs(stream, "\t");
                stream.Close();
 
                //Re-Opening the saved TSV file
                workbook = application.Workbooks.Open("Output.tsv");
 
                //Saving the workbook as xlsx file
                stream = File.Create("Output.xlsx");
                workbook.SaveAs(stream);           
            }
        }
    }
}

VB

Imports Syncfusion.XlsIO
Imports System.IO
Imports System.Reflection
 
Namespace XlsIO_Supports_TSV
 
    Class Program
 
        Private Shared Sub Main(ByVal args() As String)
            Using excelEngine As ExcelEngine = New ExcelEngine()
                'Instantiate the excel application object.
                Dim application As IApplication = excelEngine.Excel
 
                'The workbook is opened.
                Dim workbook As IWorkbook
 
                'Open existing workbook with data entered
                Dim assembly As Assembly = GetType(Program).GetTypeInfo.Assembly
                Dim fileStream As Stream = assembly.GetManifestResourceStream("XlsIO_Supports_TSV.Sample.xlsx")
 
                workbook = application.Workbooks.Open(fileStream, ExcelOpenType.Automatic)
 
                'The first worksheet object in the worksheets collection is accessed.
                Dim worksheet As IWorksheet = workbook.Worksheets(0)
 
                'Saving the workbook as TSV file
                Dim stream As Stream = File.Create("Output.tsv")
                workbook.SaveAs(stream, "" & vbTab)
                stream.Close()
 
                'Re-Opening the saved TSV file
                workbook = application.Workbooks.Open("Output.tsv")
                'Saving the workbook as xlsx file
 
                stream = File.Create("Output.xlsx")
                workbook.SaveAs(stream)
            End Using
        End Sub
    End Class
End Namespace

 

 

 

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile