If you are on Windows and your text file is named C:\dir\names.txt
, then you can use
names = StringSplit[Import["C:/dir/names.txt"], "\n"]
to import the file, and then split the resulting string at the end of each new line into an array of strings. Note the different direction of the slashes.
If you aren't on Windows, the command is the same, but the directory won't be prefixed with a drive letter.