Open Text Files as Workbooks

Below are comparison code examples for opening a text file as workbooks:

VSTO

    this.Application.Workbooks.OpenText(@"OpenTextFilesAsWorkbooks.txt",
        missing, 3,
        Excel.XlTextParsingType.xlDelimited,
        Excel.XlTextQualifier.xlTextQualifierNone,
        missing, missing, missing, true, missing, missing, missing,
        missing, missing, missing, missing, missing, missing);

Aspose.Cells

    private static string fileName = "OpenTextFilesAsWorkbooks.xlsx";

    private static string TextFile = "OpenTextFilesAsWorkbooks.txt";

    // LoadOptions to represent the options for loading the file
    LoadOptions loadOptions = new LoadOptions(LoadFormat.CSV);

    Workbook newWorkbook = new Workbook(TextFile, loadOptions);

    newWorkbook.Save(fileName);

Download