Skip to main content
1 of 4
gc5
  • 379
  • 1
  • 4
  • 8

How to know if a text file is a subset of another

I am trying to find a way to predict if a text file is a subset of another..

For example:

foo
bar

is a subset of

foo
bar
pluto

While:

foo
pluto

and

foo
bar

are not one a subset of each other..

Is there a way to automatically predict this?

This check must be a cross check, and it has to return:

file1 subset of file2 :    True
file2 subset of file1 :    True
otherwise             :    False

Thanks

gc5
  • 379
  • 1
  • 4
  • 8