Excel Text to Column Java

MS Excel provides the Text to Columns feature to split the text into multiple columns. The splitting can be based on a blank space, a comma, a special character, etc. In order to automate the feature, this article covers how to perform Excel’s Text to Columns from within your Java applications. The step-by-step guide and code sample will show you how to split text in a column in an Excel worksheet.

Java API to Split Text to Columns in Excel

In order to split the text into columns in Excel worksheets, we’ll use Aspose.Cells for Java. It is a powerful API that lets you create, process, and convert Excel files from within your Java applications. You can either download the API or install it using the following Maven configurations.

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>https://repository.aspose.com/repo/</url>
</repository>
<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-cells</artifactId>
    <version>21.6</version>
</dependency>

Split Text to Columns in Excel using Java

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

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

Output

Excel Text to Column Python

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 implement Excel’s text to columns feature using Java. The code sample has shown you how to split the text in a column into multiple columns within a few steps. You can explore more about Aspose.Cells for Java using the documentation. In case you would have any queries, contact us via our forum.

See Also