



User Guide EasyXLS Basics Import files Import TXT file in .NET, Java and other programming languages Tweet Import TXT file in .NET, Java and other programming languages Concept EasyXLS™ library allows you to import data fromTXT file format and specify the separators for data in rows and columns.



EasyXLS can be successfully used inclusively to import large TXT files having big volume of data with fast importing time. Concept in action The below example is a common code about how to import data from TXT file. Source code sample C#.NET VB.NET C++.NET J#.NET Java PHP ASP C++ VB6 VBS Coldfusion // Create an instance of the class that imports TXT files ExcelDocument workbook = new ExcelDocument(); // Import TXT file workbook.easy_LoadTXTFile("C:\\Samples\\Excel.txt"); ' Create an instance of the class that imports TXT files Dim workbook As New ExcelDocument ' Import TXT file workbook.easy_LoadTXTFile("C:\Samples\Excel.txt") // Create an instance of the class that imports TXT files ExcelDocument *workbook = new ExcelDocument(); // Import TXT file workbook->easy_LoadTXTFile("C:\\Samples\\Excel.txt") // Create an instance of the class that imports TXT files ExcelDocument workbook = new ExcelDocument(); // Import TXT file workbook.easy_LoadTXTFile("C:\\Samples\\Excel.txt"); // Create an instance of the class that imports TXT files ExcelDocument workbook = new ExcelDocument(); // Import TXT file workbook.easy_LoadTXTFile("C:\\Samples\\Excel.txt"); // Create an instance of the class that imports TXT files $workbook = new COM("EasyXLS.ExcelDocument"); // Import TXT file $workbook->easy_LoadTXTFile("C:\\Samples\\Excel.txt") ' Create an instance of the class that imports TXT files Set workbook = Server.CreateObject("EasyXLS.ExcelDocument") ' Import TXT file workbook.easy_LoadTXTFile("C:\Samples\Excel.txt") // Create an instance of the class that imports TXT files EasyXLS::IExcelDocumentPtr workbook; hr = CoCreateInstance(__uuidof(EasyXLS::ExcelDocument), NULL, CLSCTX_ALL, __uuidof(EasyXLS::IExcelDocument), (void**) &workbook) ; // Import TXT file workbook->easy_LoadTXTFile("C:\\Samples\\Excel.txt") ' Create an instance of the class that imports TXT files Set workbook = CreateObject("EasyXLS.ExcelDocument") ' Import TXT file workbook.easy_LoadTXTFile("C:\Samples\Excel.txt") ' Create an instance of the class that imports TXT files set workbook = CreateObject("EasyXLS.ExcelDocument") ' Import TXT file workbook.easy_LoadTXTFile("C:\Samples\Excel.txt") <!-- Create an instance of the class that imports TXT files --> <cfobject type="java" class="EasyXLS.ExcelDocument" name="workbook" action="CREATE"> <!-- Import TXT file --> <cfset success = workbook.easy_LoadTXTFile("C:\Samples\Excel.txt")> Import text file with encoding EasyXLS allows you to import TXT files with specific encoding using System.IO.StreamReader class in .NET and java.io.InputStreamReader class in Java with ExcelDocument.easy_LoadTXTFile, ExcelDocument.easy_ReadTXTFile_AsDataSet or ExcelDocument.easy_ReadTXTFile_AsList methods. Read text file into DataTable in C# and VB.NET EasyXLS library can be used to import TXT file into DataTable. The DataTable can be the used as data source of a GridView, DataGridView, DataGrid or for any other purposes.



The data from the TXT file can be read using ExcelDocument.easy_ReadTXTFile_AsDataSet method and then the DataTable can be obtained from the imported DataSet. See also: Read text file into GridView in C# and VB.NET from ASP.NET EasyXLS library can be used to import TXT data into GridView from ASP.NET web applications.



The data from the TXT file can be read using ExcelDocument.easy_ReadTXTFile_AsDataSet method and then the DataTable for the GridView can be obtained from the imported DataSet. See also: Read text file into DataGridView in C# and VB.NET EasyXLS library can be used to import TXT data into DataGridView from windows applications and windows forms.



The data from the TXT file can be read using ExcelDocument.easy_ReadTXTFile_AsDataSet method and then the DataTable for the DataGridView can be obtained from the imported DataSet. See also: Read text file into DataSet in C# and VB.NET EasyXLS library can be used to import TXT file into DataSet from windows applications, ASP.NET pages or console applications.



The data from the TXT file can be read using ExcelDocument.easy_ReadTXTFile_AsDataSet method. See also: Read text file into ResultSet in Java EasyXLS library can be used to import TXT file into ResultSet from Java applications.



The data from the TXT file can be read using ExcelDocument.easy_ReadTXTFile_AsResultSet method. See also: Read text file into list EasyXLS library can be used to import TXT file into lists of data.



The data from the TXT file can be read using ExcelDocument.easy_ReadTXTFile_AsList method. See also: Read text file into DataGrid in C# and VB.NET EasyXLS library can be used to import TXT data into DataGrid from windows applications and windows forms.



The data from the TXT file can be read using ExcelDocument.easy_ReadTXTFile_AsDataSet method and then the DataTable for the DataGrid can be obtained from the imported DataSet. See also: Import CSV files EasyXLS allows you to import data from CSV files using specific methods. See also:

Getting started with EasyXLS Excel library To download the trial version of EasyXLS Excel Library, press the below button:





If you already own a license key, you may login and download EasyXLS from your account.



See also:

Related methods:

Available for: Professional, Excel Reader



