Split Text to Columns in Excel using C#

Split Text to Columns in Excel C#

Text to columns feature in MS Excel 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 using C#.

C# API to Split Text to Columns in Excel

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

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

Get a Free API 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 split the 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