Add columns in data table

@Yoichi

You have helped me in this post and all good. Thank you

But now business wants to add document, Date, CurrentDate columns from inputsheet. I am not sure how to do that

Expected output :grinning:

How do i add document,Date,current date in below code?

dt = dt.AsEnumerable.Where(Function(r) not String.IsNullOrEmpty(r(“Language”).ToString)).GroupBy(Function(r) r(“Key”).ToString).Select(Function(g) g.OrderByDescending(Function(r) arr.Contains(r(“Language”).ToString)).First).CopyToDataTable

Also document,Date,current date in this code?
dt = dt.AsEnumerable.Select(Function(r) dt.Clone.LoadDataRow({r(0),r(1),r(2),Cint(r(2))+2},False)).CopyToDataTable()

Hi,

Can you also share input sheet?

Regards,

newresult.xlsx (6.6 KB)

Thank you… Please find the input file for ModifyExtractedData.Xaml

ModifyExtractedData.xaml (9.6 KB)

Expected output:

Hi,

Can you try the following?

io_dtModifiedExtractedFile.Columns("NewRowNo").SetOrdinal(3)

io_dtModifiedExtractedFile = io_dtModifiedExtractedFile.AsEnumerable.Select(Function(r) io_dtModifiedExtractedFile.Clone.LoadDataRow({r(0),r(1),r(2),Cint(r(2))+2,r(4),r(5),r(6)},False)).CopyToDataTable()

Sample20230512-3.zip (15.3 KB)

Regards,

1 Like

Thanks a lot

1 Like

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