How to write unstructured data in txt file to excel file

Hi bro @bcorrea, I have seen many of your answers which are really good and helpful. Could you please help me. I have to write the unstructured data from a txt file to excel file. here Im sharing the image of the unstructured data in txt file.
and there are few conditions which has to be followed

  1. Ignore any line numbers that starts with ZERO ‘0’
  2. Read line which starts with ‘2’. If the next character is not ‘U’, Reject the message
  3. Read each line which starts with ‘3’ which will have flight numbers.
  4. Stop when line number starts with ‘5’

Hi

Welcome to uipath forum

Hope these below steps would help you resolve this

Once after reading the sheet and saving it as a string variable use a assign activity like this
str_output = System.Text.RegularExpressions.Regex.Replace(inputstring.ToString,”[0]+”,””).ToString

  1. Now all the rows starting with 0 will be replace with blank lines

str_output = String.Join(Environment.NewLine,str_output.ToString.Split(Environment.NewLine,StringSplitOptions.RemoveEmptyEntries)).ToString

  1. Then I have few clarification required
    Read in a way like you want those rows or how it should be
    Pls paste the required output table as a screenshot

But the above steps will help you till then

Cheers @Sirimalla_Karthik_Chandra

Hi @Palaniyappan , Thank you for replying to my question. I’m attaching an image. In which you can find how each line is specified. And I need to add headers as shown in the image.