How to Split the Rows in a Data Table into multiple Data Tables?

Hi All,

Can someone please help me to understand to split the data table to multiple data tables depending on the column A Text. Payroll, TDML, MICRO

Thank you so much for your kind help in advance.

Regards,
Vishnu
Test.xlsx (9.8 KB)

Hi @Vishnu_Vardhan_Addagada

Check the below thread…

Hope it helps!!

1 Like

Hi @mkankatala ,

Thank you for your kind reply.
But how can I split dynamically based on the text given? would you please suggest.

Regards,
Vishnu

Hi @Vishnu_Vardhan_Addagada ,
In my way, you can find index of text: Payroll, TDML, MICRO
then read range base on index
regards,

1 Like

@Vishnu_Vardhan_Addagada Please find the solution flow.
Main.xaml (7.7 KB)

1 Like

Hi @devasyasingh.

Thank you for your reply.

Unable to execute the file as it showing the error for regex.

Hi @Nguyen_Van_Luong1 ,

Thank you for your kind reply.

Using lookup data table I am able to get the index but how get the read from for complete column and rows
from Payroll Index to TDML Index
From TDML to MICRO
From MICRO to end of the row

@Vishnu_Vardhan_Addagada for dt_Payroll write in range - “A”+(CINT(System.Text.RegularExpressions.Regex.Match(RangePayroll,“\d+”).Value.ToString)+1).ToString+“:”+RangeTDML.Replace(“A”,“I”)

dt_TDML write in range - “A”+(CINT(System.Text.RegularExpressions.Regex.Match(RangeTDML,“\d+”).Value.ToString)+1).ToString+“:”+RangeMICRO.Replace(“A”,“I”)

dt_MICRO write in range -“A”+(CINT(System.Text.RegularExpressions.Regex.Match(RangeMICRO,“\d+”).Value.ToString)+1).ToString

Also import System.Text.RegularExpressions Namespace in the project

1 Like

Hi,
first step, you read all to get all data
get index of Payroll Index to TDML Index → have 2 value index , call are start and end ->read range from start to end get → dataPayroll

next step, get index From TDML to MICRO-> have 2 value index , call are start and end ->read range from start to end get → dataTDML

last, get index MICRO to end of the row-> have 2 value index , call are start and end ->read range from start to end get → data MICRO

regards,

1 Like

Hi, @Vishnu_Vardhan_Addagada
my code
Main.xaml (21.9 KB)
my input
Test.xlsx (9.9 KB)
my output in csv
output.zip (1.3 KB)
full path
Split Data.zip (24.5 KB)
regards,

1 Like

Thank you so much @Nguyen_Van_Luong1

I have used the similar way but using lookup datatable to get the index.

Cheer @Vishnu_Vardhan_Addagada

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