Demo of a program to print a random line from a given file.
The "numbers.txt" file must exist and be in the current directory;
see Directory[] and SetDirectory["some/where"] (unix) or SetDirectory["some\where"] (windows)

The complicated next mess sets the directory to the same as this file.

On my first attempt, I used Random[Length[theList]] which gives a bug.  Exercise: explain.

SetDirectory[
        DirectoryName[
          ToFileName["FileName" /. 
              NotebookInformation[
                SelectedNotebook[]]]]];
\(\(printRandomLineFromFile[filename_] := 
        Block[\ {theList, n}, 
		theList = 
            ReadList[filename, \ String]; 
		n\  = \ 
            Random[Integer, {1, 
                Length[theList]}]; 
		Print[
            theList[\([n]\)]]];\)\)
printRandomLineFromFile::usage = "printRandomLineFromFile[filename] \
returns a random line from the file with the given name.";

setDirectoryFromNoteBook[];
Do[printRandomLineFromFile["numbers.txt"], {20}];