Hi Team,

I have an excel sheet, in one column I have number and contains blank and if 1 is there then to next that column it should write as Case1, and the number 2 and 3 continue, it should write Case2 next to 2 number

PFA,

Thanks

Hi Team,

I have an excel sheet, in one column I have number and contains blank and if 1 is there then to next that column it should write as Case1, and the number 2 and 3 continue, it should write Case2 next to 2 number

PFA,

Thanks

Hey!

You can try out the following steps:

- Read the excel data into an DataTable say input_DT"
- Use a For each row in Datatable activity to loop through the records
- Inside for each

if(Not String.IsNullOrEmpty(CurrentRow(“Xperia”).Tostring)

then

in Assign use IndexOfCurrentRow = Input_DT.Rows.IndexOf(CurrentRow) - Use a Write cell activity in the and write the value as “Case”+CurrentRow(0).Tostring
- In the Range for the cell use “B” + (IndexOfCurrentRow +2).Tostring - Here adding 2 because the Index starts with 0 in Datatable and you have Headers in the Excel

Regards,

Rajeswari

1 Like

It did not work, if it worked for you can you send the xaml file

Hey,

Check out this xaml and the excel file where the output was written in B column.

Test.xlsx (8.9 KB)

Main.xaml (7.8 KB)

Regards,

Rajeswari

The above workflow will work the way you need. Please change in input file path to your desired Excel file and it will work.

sample output

Regards,

Rajeswari

But this is not matching, when we have 1 row as Case1, 2rows continuously Case2 and 3rows continuously as Case3

Thank you

Regards,

Sharan

In the first screen shot I have showed that sample

first as you shown

are you able to find any solution?

Thank you

Hay,

where 2 and 5 is there, it should write as Case2 but it is writing Case4

Hi Sharanabasava,

Please check and let me know if you get any difficulties.

FinalData.xlsx (9.2 KB)

Sample.xaml (10.6 KB)

Thanks,

Rounak

when I ran the bot, I am getting this has output

Hi Sharanabasava1,

if this output is As you expected then

Please Accept the Solution or else let me know

Thanks

Rounak

This is not the output what I was excepting,

Please find the below screen shot

Hi Rajeswari,

did you find any logic how to do? I am trying but not success

Thank you for your help

Hello @Sharanabasava1

Please confirm how you are getting this excel?

If you are adding the data to the excel through some process, then we need to think of a standardization in that process.