Split one excel files into multiple files based on 100 rows per file

Hi,

I’m new to uipath. I’m trying to split one excel files into multiple excel files based on 100 rows per file and I have to give a new file name for each created excel file.

Any suggestions? Example will be better.

Thanks.
BC

@kohbc

Suppose if you have data from Column A to Column D then try like this:

  1. use Read Range activity to read data from excel file and specify range like this:

“A1:D100” , “A101:D200” etc…

  1. And then use Write Range activity to write into excel file.
3 Likes

Hello,

Check this XAML file Main.xaml (16.9 KB)
It reads the excel given, splits the rows for each 100 and creates new excel files.
This will automatically takes the column dynamically and considers it as well.
Hope this helps.

1 Like

@anon62075255 hii i went through your xaml file seems like showing some errors like missing or invalid activities plz have a look.

I have used Excel Scope, read range, Multiple Assign, and Write Range.
These are the packages i have in my system
image

@anon62075255 thanks for the reply,error is from my end i just updated those it’s working now.

Did that solution work for you?

Thank you for your help. I’m don’t understand your solution. I need more time to go through your solution as I’m new to uipath.

Regards,

Boon Chew

@anon62075255 hiiii i got a query can you explain me what does it mean

as i know this is what it mean right
MID (“text”, start_num, num_chars) this is where i struck,plz elaborate that.

Dt.Columns.Count will give you total number of columns present in the actual file(before splitting by 100 rows). The column number will be in integer number. But in the excel, the column names are in Alphabets. The logic here is to convert number to alphabet.
Further ReadRange activity needs Range of how many columns should be considered to write it to new file. This Converted Alpha will help pass the range.

@anon62075255 hiii just now i run it, working perfectly.thank you.

1 Like

@Loons, thanks for bringing up the flaw in converting number to Aplha in excel. If the column value is more than 26, then the above logic might not work.
Consider thisMain.xaml (9.7 KB) if you are working with the column more than 26.

Hey hi @lakshman, I tried this logic but getting as below Error. Can you please help me out in it.

Logic is below,

logic

Thanks in advance

@sushmitha.e

Uncheck AddHeaders option and then try once.

Yep done, getting the same error!

@sushmitha.e

Once check excel file Column Names whether anyone is repeated or what ?

Nope they are not repeated. Below the excel I am trying for.

POLK COUNTY RESULTS_Entity.xlsx (119.3 KB)

@sushmitha.e Why are you reading the Excel file from the Range A101 ?

Because I need from that range, 101- 200;201-300. In this way.

@sushmitha.e I guess you can do that after reading the whole Excel File by using Skip and Take Methods of Datatable