File operations

Hi,
could you tell me how to compare 2 files (if a block of the first file
contains the second file).
for example.
file 1:

-----
-----
-----



file 2:

I need to verify if the content of the 2nd file is present on the first
file
I hope you can help me with this

Olita Olita wrote:

Hi,
could you tell me how to compare 2 files (if a block of the first file
contains the second file).

You can load the two files in two strings

str1 = IO.read(“file1”)
str2 = IO.read(“file2”)

and now search if str2 is contained in str1

… if str1.include? str2

tiziano

Tiziano M. wrote:

Olita Olita wrote:

Hi,
could you tell me how to compare 2 files (if a block of the first file
contains the second file).

You can load the two files in two strings

str1 = IO.read(“file1”)
str2 = IO.read(“file2”)

and now search if str2 is contained in str1

… if str1.include? str2

tiziano

thank you :slight_smile: … it’s working now :smiley:

Olita