Need to concatenate value with a variable value without using for each

Hello,

Var1 = www.abc.com"

Excel sheet contains column as below

need output as follows


i dont want use the for each as data is huge

need vba or linq syntax.

Thanks.
@ashokkarale @Yoichi @Anil_G @lrtetala

@tejas.kotharkar

first read the datable as dtInput and variable will be variable1
try the below linq in assign activity

dtOutput = dtInput.AsEnumerable().
Select(Function(row) dtInput.Columns(0).Table.NewRow()).CopyToDataTable()

dtOutput = dtInput.AsEnumerable().
Select(Function(row)
dtInput.Columns(0).Table.NewRow().ItemArray = {If(CInt(row(0)) <= 5, variable1 & “'” & row(0) & “'”, row(0))}
dtInput.Columns(0).Table.Rows(dtInput.Columns(0).Table.Rows.Count - 1)
).CopyToDataTable()

cheers!!

Hi @tejas.kotharkar

Can you try the below

dt_Input.AsEnumerable().ToList().ForEach(Sub(row) row("Numbers Link") = var1 & "'" & row("Numbers Link").ToString() & "'")

Input:

Output:

Regards,

1 Like

@tejas.kotharkar,

Hope the solutions provided meet your requirements. Feel free to let me know if any issue.

Yes thanks it helped me

1 Like

Thank you for the reply

1 Like

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