breakdown string in one cell(first screenshot) into different cells(second screenshot) in excel
May I know the best and most reliable way of doing this?
breakdown string in one cell(first screenshot) into different cells(second screenshot) in excel
May I know the best and most reliable way of doing this?
Please follow the below steps…this can be used even if rows increase
newdt = dt.Clone()
in assigndt
Currentrow("Days").Tostring.Split(";",Stringsplitoptions.RemoveEmptyEntries).ToArray
… make sure to change type argument to stringCurrentrow("Times").Tostring.Split(";",Stringsplitoptions.RemoveEmptyEntries).ToArray
… make sure to change type argument to string{currentrow("Name").Tostring,currentrow("Email").Tostring,item1,item2}
Hope this helps
Cheers
Hi,
Hope the following sample helps you.
dt = dt.AsEnumerable.SelectMany(Function(r) r("Days").ToString.Split({";"c},StringSplitOptions.RemoveEmptyEntries).SelectMany(Function(d) r("Times").ToString.Split({";"c},StringSplitOptions.RemoveEmptyEntries).Select(Function(t) dt.Clone.LoadDataRow({r(0),r(1),d,t},False)))).CopyToDataTable
Sample20230114-2aL.zip (2.9 KB)
Regards,
@Anil_G - this is how I did it currently, but I wasted to check if there are any better options
I will try this, thank you @Yoichi