Search for a value in a text file , if text is present , pick the matched row and add in another excel file

Hi All,

I have a huge text file having rows greater than 11L, i need to search for a value in a text file , if text is present , pick the matched row and add in another excel file.
What i tried is converting the text file to Datatable using generate Datatable but there is a size limit and i get the below error"

Write range: Row Number must be between 1 and 1048576"

Any idea how this can be achieved?

Hello,

Check this out:

BR,
Chaitanya

Hi @MANISHA_V_ARORA

  1. Read the text file and store in string variable str_var

2.Now use below linq query

str_output =String.Join(Environment.NewLine, Split(str_input,Environment.NewLine).Where(Function(e) e.ToString.Contains(input_value)).ToArray)
[input_value is the input value u need to check in text file]

Now use the str_output in generate datatable to generate the datatable and save in excel

Hope the logic helps you
Regards,
Nived N
Happy Automation

1 Like

Thank you Nived for the solution.

What I tried is, I used a Read text file activity, then generate data table Activity, filter data table activity and then write range activity

1 Like

Did that worked for u

Yes it worked Nived

1 Like

Please mark the appropriate solution so that we can close the topic :blush:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.