Split Text to Columns in Excel C#

MS Excel’s text to columns feature allows you to split text in a column into multiple columns. You can split the text on a blank space, a comma, or any other character. In order to automate the feature, this article covers how to split text to columns in Excel files in C#.

Excel’s Text to Columns in C# - API Installation

In order to split text into columns in Excel files, we’ll use Aspose.Cells for .NET. It is a spreadsheet manipulation API that lets you create, modify or convert Excel files in .NET applications. You can either download the API or install it using NuGet.

PM> Install-Package Aspose.Cells

C# Split Text to Columns in Excel

The following are the steps to split text to columns in Excel using C#.

The following code sample shows how to split text to columns in Excel.

Output

Split Text to Column in Excel

Excel Text to Column C# API - Get a Free License

You can get a temporary license in order to use the API without evaluation limitations.

Conclusion

In this article, you have learned how to split text to columns in Excel files using C#. The code sample has shown how easy it is to implement Excel’s text to columns based on a particular character. You can explore more about Aspose.Cells for .NET using the documentation. In case you would have any queries, contact us via our forum.

See Also