I have csv data i want to update particular columns row data in first row only in duplicate record

Condition
1.Update data on 1st row and delete previous data
2. only consider duplicate rows based on ID and PTEmp
3.Update only 4 column data (e.g.Product,Sample,P1,S1)
for better understanding please refer screenshot

@suyog79

follow the steps

  1. Read the data into Datatable dt and create two variables for storing ID and PTEmp and intialize with string.Empty and create a rowindex to store the first blank row value and intialize with -1
  2. Use for each row in datatable and assign a index variabel to index property in for each properties
  3. Inside the loop use if ID=currentRow("ID").ToString and PTEmp = currentRow("PTEmp").ToString
  4. on then side do nothing…on else side update the values of ID and PTEmp with currentorw values using assign and also update rowindex = -1
  5. if String.IsNullOrEmpty(currentRow("Prodcut").ToString) and rowindex=-1
  6. on then side use assign rowindex = index
  7. On else side use if condition and check rowindex=-1 and then side do nothing, else side use assign activity with dt.Row(rowindex)("Product") = currentRow("Product").ToString and similarly for other columns also use assign and assign the value…and then use rowindex = rowindex+1 and also currentRow("Product") = String.Empty and repeat for other 4 columsn also to remove data

Hope this helps

cheers

I want to update only four column row in above rows
if possible could you send me xaml file

@suyog79

I have given logic for 4 only…

BlankProcess - Copy (10).zip (6.0 KB)

If you have issue here is the screnshot



index variable is assigned to index in for loop

cheers

Thanks @Anil_G for your help
i want to move row value on first row not in above empty row

@suyog79

please share the file that would be easy to debug…I understood the flow…but need a sample file

cheers

Sure
DataSet.xlsx (10.5 KB)

@suyog79

Please check this…missed one condition…now it is as expected

BlankProcess - Copy (11).zip (6.8 KB)

in the second else inside rowindex=-1 …missed the above condition

cheers

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