Check if a string exists in a list

GuillaumeL

Новичок
Регистрация
28.03.2018
Сообщения
3
Благодарностей
0
Баллы
1
Hello,

I tried for hours to solve this simple problem and followed this advice without success: http://zennolab.com/discussion/threads/search-in-list-and-tables-via-c-macro.10733/

I have two files :

- new_domains.txt
- all_domains.txt

I want to check if each domain in new_domains.txt exists in all_domains.txt. If it exists, delete it from new_domains.txt.

Can you help me with this please?
Thank you
Guillaume
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113
Hi.

With domains there is tricky, Because if you want to compare for example.

domain.com and domain.com/ OR www.domain.com and domain.com this will say those domains/string are different.

So first question is, do you have all domains in same format ?

If not then first you have to make all domains to root domains and only then check lists against each other.
 

GuillaumeL

Новичок
Регистрация
28.03.2018
Сообщения
3
Благодарностей
0
Баллы
1
Thank you for your answer.

Yes the domains are all in the same format : domain.com
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113
Okay then You have to do like this.

1. Take first line of new_domains.txt set in variable newDomain.
2. Create loop of taking lines one by one from all_domains.txt
3. Compare each line and save in other list

Things You will need:

Lists: to save data and take data from files: http://zennolab.com/wiki/en:list
Loops to check through all file line by line: http://zennolab.com/wiki/en:looping
Logic IF action to compare domains: http://zennolab.com/wiki/en:logic

PS: Tag or quote me if you want me to see Your answer.
 

GuillaumeL

Новичок
Регистрация
28.03.2018
Сообщения
3
Благодарностей
0
Баллы
1
Okay then You have to do like this.

1. Take first line of new_domains.txt set in variable newDomain.
2. Create loop of taking lines one by one from all_domains.txt
3. Compare each line and save in other list

Things You will need:

Lists: to save data and take data from files: http://zennolab.com/wiki/en:list
Loops to check through all file line by line: http://zennolab.com/wiki/en:looping
Logic IF action to compare domains: http://zennolab.com/wiki/en:logic

PS: Tag or quote me if you want me to see Your answer.
Thanks, I did it and it's working fine. However, it's very long to run as I have more than 2000 domains to check in all_domains.txt.
Do you know if there is a faster way?

Thanks
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)