from aspose.cells import TxtLoadOptions, Workbook # For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET # The path to the documents directory. dataDir = RunExamples.GetDataDir(".") # Create a workbook. wb = Workbook() # Access first worksheet. ws = wb.worksheets[0] # Add people name in column A. Fast name and Last name are separated by space. ws.cells.get("A1").put_value("John Teal") ws.cells.get("A2").put_value("Peter Graham") ws.cells.get("A3").put_value("Brady Cortez") ws.cells.get("A4").put_value("Mack Nick") ws.cells.get("A5").put_value("Hsu Lee") # Create text load options with space as separator. opts = TxtLoadOptions() opts.separator = ' ' # Split the column A into two columns using TextToColumns() method. # Now column A will have first name and column B will have second name. ws.cells.text_to_columns(0, 0, 5, opts) # Save the workbook in xlsx format. wb.save(dataDir + "outputTextToColumns.xlsx")