Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Document-Processing-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -6773,9 +6773,12 @@
<li>
<a href="/document-processing/excel/excel-library/net/faqs/how-to-set-invert-if-negative-option-for-a-chart">How to set invert if negative option for a chart using XLsIO?</a>
</li>
<li>
<li>
<a href="/document-processing/excel/excel-library/net/faqs/how-to-merge-cells-preserving-topleft-value-and-format-in-xlsio">How to merge cells preserving topleft value and format in XlsIO?</a>
</li>
<li>
<a href="/document-processing/excel/excel-library/net/faqs/how-to-open-a-csv-file-with-a-tab-delimiter-using-xlsio">How to open a CSV file with a tab delimiter using XlsIO?</a>
</li>
</ul>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: How to open a CSV file with a tab delimiter using XlsIO? | Syncfusion
description: This FAQ explains how to open a CSV file with a tab delimiter using Syncfusion XlsIO Excel library by passing the delimiter as an argument to the Open method.
platform: document-processing
control: XlsIO
documentation: UG
---

# How to open a CSV file with a tab delimiter using XlsIO?

Syncfusion XlsIO allows you to open CSV files with custom delimiters, including tab delimiters. When opening a CSV file, you can specify the delimiter character as the second parameter in the [Open](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IWorkbooks.html#Syncfusion_XlsIO_IWorkbooks_Open_System_String_Syncfusion_XlsIO_ExcelOpenType_) method.

The following code example illustrates how to open a CSV file with a tab delimiter using XlsIO.

{% tabs %}
{% highlight c# tabtitle="C# [Cross-platform]" %}
using (ExcelEngine excelEngine = new ExcelEngine())
{
// Instantiate the Excel application object
IApplication application = excelEngine.Excel;

// Assign default application version
application.DefaultVersion = ExcelVersion.Xlsx;

// Open a CSV file with a tab delimiter ("\t")
IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.csv"), "\t");

// Access the first worksheet from the workbook
IWorksheet worksheet = workbook.Worksheets[0];

// Save the workbook to disk in XLSX format
workbook.SaveAs(Path.GetFullPath(@"Output/Output.xlsx"));
}
{% endhighlight %}

{% highlight c# tabtitle="C# [Windows-specific]" %}
using (ExcelEngine excelEngine = new ExcelEngine())
{
// Instantiate the Excel application object
IApplication application = excelEngine.Excel;

// Assign default application version
application.DefaultVersion = ExcelVersion.Xlsx;

// Open a CSV file with a tab delimiter ("\t")
IWorkbook workbook = application.Workbooks.Open("InputTemplate.csv", "\t");

// Access the first worksheet from the workbook
IWorksheet worksheet = workbook.Worksheets[0];

// Save the workbook to disk in XLSX format
workbook.SaveAs("Output.xlsx");
}
{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
Using excelEngine As New ExcelEngine()
' Instantiate the Excel application object
Dim application As IApplication = excelEngine.Excel

' Assign default application version
application.DefaultVersion = ExcelVersion.Xlsx

' Open a CSV file with a tab delimiter ("\t")
Dim workbook As IWorkbook = application.Workbooks.Open("nputTemplate.csv", "\t")

' Access the first worksheet from the workbook
Dim worksheet As IWorksheet = workbook.Worksheets(0)

' Save the workbook to disk in XLSX format
workbook.SaveAs("Output.xlsx")
End Using
{% endhighlight %}
{% endtabs %}

A complete working example in C# is present on <a href="https://github.com/SyncfusionExamples/XlsIO-Examples/tree/997601-CSV-Tab/FAQ/CSV%20With%20Tab/.NET/CSV%20Wtih%20Tab">this GitHub page</a>.