Reading The Row and splitting


#1

Hi,
I want to read an Excel row and if the last 4 digits equals of all the values present in the column of the row matches the condition then i want those all the rows to be written into separate excel sheet.
Please help asap.
For example,there is an Excel sheet with
Item No.
ABGLG=1
CDGLG=1
FFGLG=1
SEW=4
JKGLG=5

So i want to pick up only those rows whose last ends with “GLG=1” and writes it into separate excel sheet.

@harinathreddy.yn please suggest on this as well


#2

Hi @somya177,

Please find the attached workflow for splitting the rows and write into separate excel sheet.

Splitting rows.zip (14.5 KB)

Hope it helps!

Thanks,
Saranya K R


#3

Thanks Saranya…But I need Header Names as well in the splitted sheet


#4

In Read range activity, add headers must be unchecked.


Modify the if statement.
image


#5

Hi @somya177
Please check below file.sample4.zip (9.7 KB)

Thanks,
Hari


#6

Hi,
it didn’t come .


#7

Check out the modified workflow.

Splitting rows.zip (14.2 KB)


#8

@somya177

  1. Read the excel data by using Read range activity and assign it to dataTableVariable1(Select Add header options)
  2. Using assign activity

DataTablevariable2=dataTablevariable1.Select("[Item No.] Like ‘%GLG=1’").CopyToDataTable

  1. Write datatablevariavble2 to new excel sheet(select add header options)

#9

thanks saranya…:slight_smile:
Now i have other data also to written with it which are present in column 2 and 3 with Column1 if Column1 condition matches.
Please suggest


#10

Two more collections can be created in the similar way to store Column2 and Column3 values.


#11

and then use write range activity instead of write cell finally…?
glg=1 data1 pass1
glg=2 data2 pass2

like this it has to come in separate excel


#12

Write range activity cannot be used here, as DataTable is required as input for this activity.

Instead, you can use write cell activity with “B” + count and “C” + count for two columns.


#13

for all it is giving this same data in separate excel using write cell for B and C
glg=1 data1 pass1
glg=1 data1 pass1
glg=1 data1 pass1
glg=1 data1 pass1
Instead it should give

glg=1 data1 pass1
glg=2 data2 pass2


#14

use the code which I have given and in build data table please add 2 more columns.


#15

can you please suggest something on that sharanya’s code which i have ticked solution.As i started working on that Before you sent the workflow.
Would be great help.


#16

Please confirm me whether “GLG =2” needs to be filtered out in the same way as “GLG=1”.
If possible could you send me sample excel file.


#17

yes…then GLG02 data1 pass1 will be in different excel


#18

For every “GLG=some integer”, a separate excel needs to be created. Am i right?


#19

yes…if its glg=2 data1 pass1 then a separate excel
if its glg=3 data1 pass1 then a separate excel


#20

okay, let me think and suggest you some solution.:slight_smile: