Can anyone suggest how to change TextFile to Excel file

im having a notepad text file which contains so much of data. i need to filter that file on choosing only starting M values and convert it into excel file.
i tried with generate data table activity but it shows error"very big file connt convert"

Please help me on this.
Thanks in advance

Have you tried to convert the text file to CSV and then read the CSV into DataTable?

yes, i tried getting this error"Generate Data Table: Can not generate data table because the input file is too big or contains too many rows or columns."

Hi @lalithanarayan462

Can you provide input sample text file

Regards,

  1. Use the *Read Text File and create vatiable.
  2. Filter Lines** : Use an Assign activity to filter lines starting with “M”. You can achieve this with a VB.NET expression like this.

filteredLines = textContent.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Where(Function(line) line.StartsWith(“M”)).ToArray()

  1. Store the result in a filteredLines variable of type String[] .
  2. *Generate DataTable
  3. Populate DataTable* : Loop through filteredLines using a For Each activity. Inside the loop, split each line as needed (based on your file’s format) and add a DataRow to your DataTable for each filtered line.
  4. Write to Excel : Use the Write Range activity from the UiPath.Excel.Activities package to write your DataTable to an Excel file. Specify the file path and sheet name.

Note: This approach efficiently filters lines starting with “M” and writes them to an Excel file, bypassing the limitations of directly converting a large text file with the “Generate Data Table” activity.