Remove duplicate data from the first line in Excel

hello.

I am a beginner.

Excel data values must be stored on the Web.

A, B, C… when registering each person’s hobbies
A I am registering my hobby on the web page that came up by searching my name.

After registering A by searching, you must search B and register the value.
Is there a way to set up a loop?

I have completed all sub-registration processes, but I am having a problem by looking up A again after looking up A.

After querying value A, I want to query value B.
I would like to know detailed activities and conditional statements.

example)
image

when searching the “Name” part repeatedly
Please tell me how to pass and search for duplicate values.

Thanks in advance for your reply.

Hi @myangh860 ,
My understand is you have excel file with 2 columns
1 columns is “No. name hobby”, 1 column is “value translate”
image
you want to translate each row in No. then paste translate to value
that’s right?
You can follow this step
1.read range to get data table

2.use for each row in data table, search each row then get output

3.Assign value and write back file

my output
image

Regards,

@Nguyen_Van_Luong1

Thank you for your kind reply.

However, the Excel table is different from what was intended.
I created an example table.

The actual number of names is greater and the amount of data is also greater.

Currently using the for each activity
Continue to retrieve only the value of A.

I would like to pass over duplicate name values and search for the next name.

Look up A and then B
You need to look up C after B.

thank you.

Oh, your topic is edited 6th, when I reply I don’t see your table hahaa
No problem
Can please you tell more about case duplicate in columns “name” , what value we need get at column “habobby”
or you can share your desired result
regards,

@myangh860

You want to loop through each row or only unique name rows? Can you please confirm?

Cheers

Hi @myangh860

  • Read Range

  • Assign: dtUniqueNames = dtHobbies.AsEnumerable().GroupBy(Function(row) row(“name”).ToString()).Select(Function(g) g.First()).CopyToDataTable()

  • For Each Row in dtUniqueNames

    • Assign: name = row("name").ToString()
    • If Not ProcessedNames.Contains(name)
      • Type Into: name
      • Click: Search
      • Element Exists / Find Element
      • If Element Not Exists
        • Type Into: row("hobby").ToString()
        • Click: Submit
      • Add to HashSet/List: ProcessedNames.Add(name)
      • Delay / Wait Element

Hope this helps

Thank you for your help.

I don’t speak English, so I use Google Translate.
I edited the first question because it seemed like the translation was not smooth.

We are working on entering the information from the above Excel data into the web.

I am entering hobbies corresponding to each name on the page that appears when searching by ‘name’.

I completed the whole thing, but after searching for A and entering my hobby, the A value, not the B value, is searched again.

I think we need to add a condition.
Like an ‘if’ activity or a ‘do while’ activity.

The important thing is to search for A and then B, excluding duplicate values in ‘name’.
Other than that I’ve finished everything.

thank you

Hi @myangh860 ,
Yes, I see, we can filter or check before search
image
you can see, green is rows will search
red is not search because duplicate with above
that’s right?
regards,

There is no need to repeat each line when looking up a Name.
If you repeat each row in Excel, you will get duplicate ‘names’.
I want to get non-duplicate values without getting duplicate names.

A->A (X)
A->B(O)

imagerm

i want do this.

I do not want to retrieve duplicate name values, but only retrieve non-duplicate name values.

A->A (X)
A->B(O)

Ok, it’s very clear. I understood it, I will modify my process

@myangh860

Then just use this to get dt = dt.AsEnumerable.GroupBy(function(x) x("Name").ToString + x("habobby").ToString).Select(function(x) x.First).CopyToDataTable

Thsi gives unique rows only then you can loop

Cheers

Hi @myangh860 ,
image
my newest output
but in now way, I search all then check output if
eg:
A->A (X) no search
A->B(O) search
if your input is too large I think we can use other way is filter before search
regards,

Hi @myangh860 ,
image
filter before search
we have similar output
eg:
A->A (X) no search
A->B(O) search
pls check it
regards,

Hi @myangh860 ,
Filter.zip (10.4 KB)
image
this’s output and source
regards,

Thank you for providing detailed information.

thank you so much.

1 Like

Cheer @myangh860 ,
Happy automation!

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