Please help me to understand and extract

PROD- potassium
DORD-Dubnium

input:
20203107PORD
20202101PORD
20200302DORD
20200502PORD
20200102DORD

how i can read each item and segregate if PORD is potassium and DORD is Dubnium?

Hi @Venu_V

1.Is the input present in datatable?
2.Do you need to write output in 2 sheets like Potassium and Dubnium sheets?

If that is the case then try like below

potassiumDT = (From row In InputDT.AsEnumerable()
               Where row("ColumnName").ToString.Contains("PORD")
               Select row).CopyToDataTable()
dubniumDT = (From row In InputDT.AsEnumerable()
             Where row("ColumnName").ToString.Contains("DORD")
             Select row).CopyToDataTable()

Regards,

@Venu_V,

What’s source of data and datatype?
What’s expected output?

input is of string type . And output it has to write string only .

@Venu_V

Try this

Potassium = String.Join(", ", Input.Split(Environment.NewLine.ToCharArray).Where(Function(x) x.Contains("PORD")))

Dubnium = String.Join(", ", Input.Split(Environment.NewLine.ToCharArray).Where(Function(x) x.Contains("DORD")))

Output:

An output log shows the execution process for file "Sequence18" with detailed information including the start and end of "BlankProcess23" and entries for Potassium and Dubnium with associated dates and codes. (Captioned by AI)

Regards,

Perfect. Thank you so much

@Venu_V

Glad it helped! Can you please mark it as solution to close the thread

Regards,

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