C
C
Chvalov2015-01-02 02:01:51
Text Processing Automation
Chvalov, 2015-01-02 02:01:51

How to select different links from text documents?

There are two text files *.txt in them there are more than 100k links, how can I select only those links that are not in the first document if the links are scattered?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Terentiev, 2015-01-02
@maxitso

comm -1 text1.txt text2.txt >text3.txt
But you can sort both first, then compare
sort text1.txt > sort1.txt
sort text2.txt > sort2.txt
comm -1 sort1.txt sort2.txt > text3.txt
or add to the second:
comm -1 sort1.txt sort2.txt >> sort2.txt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question