Validating the content of a file

I want to load a file and make some validations in this file, but i don’t know how, can help me ?

Here’s a simple example:

“text.txt” file containing some words:

I really love watching the sunset in the evening.

  1. RF code to validate if the word “love” exists in the file

*** Settings ***
Library OperatingSystem

*** Test Cases ***
Test
${string} get file text.txt
should contain ${string} love

Output:

  1. RF code to validate if the word “puppies” exists in the file

*** Settings ***
Library OperatingSystem

*** Test Cases ***
Test
${string} get file text.txt
should contain ${string} puppies

Output:

2 Likes

the file that i need make some validations is a csv, i can use this script too? and how i install this lib?

thank you!

It should work the same for CSV and the related lib should already be installed for you by having an operating system.