To split a big CSV file into mutiple csv's

Hi
–yah thats possible
–use READ CSV FILE activity and pass the filepath as input and get the output with a variable of type datatable named dt

–followed by that use a while loop activity with a condition like this
counter > dt.Rows.Count
where counter is a variable of type int32 with default value as 25000 defined in the variable panel
–inside the loop use a assign activity like this
dt1 = dt.AsEnumerable().Skip(dt.Rows.Count-counter).CopyToDatatable()
where dt1 is a variable of type system.data.datatable with default value as New System.Data.Datatable

–now use a WRITE CSV FILE activity and mention the input as dt1 and mention the file path as
“yourfolderpath\yourfilename”+Now.ToString(“hh_mm_ss”)+“.csv”

–then use CLEAR DATATABLE activity where mention the input as dt1
–and inside the while loop atlast use a assign activity like this
counter = counter + 25000

hope this would help you
kindly try this and let know for any queries or clarification
Cheers @SyedShabaz03

1 Like