A
A
a_105_a2018-11-18 00:05:42
Python
a_105_a, 2018-11-18 00:05:42

How to exclude certain text from the list?

Given 9000 url links in CSV or txt format (there is both). There is another list of url links (300 pcs). The task is to exclude the second from the first list, while all the links in the first list are in a chaotic manner. We need to automate the process. Mb someone faced similar, I'm breaking my head. I'm also looking for a program that will make an HTML document of the site from a list of links. Thanks for answers !

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pychev Anatoly, 2018-11-18
@pton

Well, if the format of links is the same everywhere, then you can first sort the lists, and then use the VLOOKUP function to search for records from one list in another, then filter by those found and delete. You are left with a list of links in which there are no links from the second list.
How is this supposed to look like?

I
Ivan Soshnikov, 2018-11-18
@soshnikov

result = (v for v in list9000 if v not in list300)
Dofiga programs that can do whatever you want from the list of links: python, Java. c#, JS, Ruby, C... Yes, thousands of them.

B
bl, 2018-11-19
@vl12

Previous answer. Or use not lists, but sets, and subtract one from the other. Google 'python set', this is a string uniqueness type and their methods for handling their differences.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question