Relevance Query for "elements of (set of (content))"

I have 2 files with content “a, b, c” & “a, c”.

I need the following output: b

# cat test1.txt
a
b
c
# cat test2.txt
a
c

Tried to implement the same with “elements of (set of (content))”. Did not get the required output.

Q: elements of (set of (concatenation ", " of substrings separated by "%0d%0a" of (lines of file "/test1.txt") as string) - set of (concatenation ", " of substrings separated by "%0d%0a" of (lines of file "/test2.txt") as string))
A: a, b, c
T: 743
Q: elements of (set of (concatenation ", " of substrings separated by "%0d%0a" of (lines of file "/test2.txt") as string) - set of (concatenation ", " of substrings separated by "%0d%0a" of (lines of file "/test1.txt") as string))
A: a, c
T: 869

Can someone let me know where am I going wrong?

Thanks in advance :slight_smile:

You were on the right track - but sets are defined by lists of elements separated by semicolons, not commas.

Therefore, you should be able to do the following, without tearing down the contents of each file and rebuilding it.

elements of (set of (lines of file "/test1.txt") - set of (lines of file "/test2.txt"))

2 Likes

Thanks @itsmpro92. That worked :slight_smile: