Hi All,
Seek your help to guide me on this. No Column headers
I need to transpose after every 4 row.
From:
To:
Appreciate the help in advance.
Thank you!
Hi All,
Seek your help to guide me on this. No Column headers
I need to transpose after every 4 row.
From:
To:
Appreciate the help in advance.
Thank you!
Hi @Shawn11 ,
Could you try with the below Steps :
Prepare a Datatable using Build Datatable
activity with 4 Columns as we need number of columns as 4, let is be named as OutputDT
.
Next, Read the Excel sheet as a Datatable without Add Headers
enabled, let the output datatable be named as DT
.
We could then use the below Expression in an Assign
activity.
OutputDT = Enumerable.Range(0,CInt(Math.Ceiling(DT.Rows.Count/4))).Select(Function(x)OutputDT.Rows.Add(DT.AsEnumerable.Skip(x*4).Take(4).Select(Function(y)y(0).ToString).ToArray)).CopyToDatatable
OutputDT
to an Excel sheet without Add Headers
being enabled.From Debug Panel :
Lets assume
Prepare an empty DataTable with Build DataTable Activity, Configure the 4 cols - dtResult
Assign Activity
dtResult =
dtData.AsEnumerable.Select(Function (x) x(0)).Chunk(4).Select(Function (x) dtResult.Rows.Add(x)).CopyToDataTable
ensure:
was this done?
It works alright now. Thank you!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.