There are some files in a directory. I have used of SetDiroctory to access all of them.
SetDirectory["C:\\Users\\SE7EN\\Desktop\\mathematica\\test"];
I can visit all theirs contents with
filenames = FileNames[]
{"Ronaldo.txt", "Messi.txt", "Beckenbauer.txt", "Zeydane.txt"}
loaddata[filenumber_] := Import[Part[FileNames[], filenumber]]
For example:
loaddata[4] 2 8 7 13 77
These are contents of Zeydane file. But I want to have imported files with the respectively devoted names. For example, desired result after that process, (which I do not know how it can be done), be same as bellow:
Ronaldo={2,3,5,8,0,1}
Messi={21,2,45,6}
Beckenbauer={11,42,5,2,7,21}
Zeydane={2,8,7,13,77}
One way is: importing them separately, Messi=Import{.....,'data'}
. But it is not the desired process, The desired process must be done automatically. Automatically importing data from directory and devoting their names in that directory to the imported list.
Thanks in advance.
FileBaseName
is useful to remove file suffixes. $\endgroup$