I have 02 text files with the bellow format:
File 1:
2017-08-16 00:00:00,115 - [INFO] TRANSACTIONS: 123456788 id: 123456 2017-08-16 00:00:00,115 - [INFO] TRANSACTIONS: 123456789 id: 123457
File 2:
123456 123457 123458 123459
The goal: I would like to get the records from file1 without the id in file2
The commands line and result that i tried:
- 1st command line:
grep -vf file2 file1
- 2nd command line:
comm -23 <(sort file1) <(sort file2)
The both of command worked but there are 3 millions records in file1 and 1 millions records in file2. The 1st command can be complete if there are not much records but it can not complete with 3 millions. The 2nd command is faster than 1st and it can be completed when I executed manually in the ssh console but it did not work with the bash script. The error has showed with "syntax error at "("
Any idea to solve this and complete the goal ?