store the first line of a file in a variable

i have to store the files in a folder and assign a variable to the the files.