I have a folder with thousands of files and I don't have a list of names of these files. They are just random.

```
asd.wav
faf.wav
gwa.wav

```

And I have a FileNames.txt with the names of files:

```
1A
2
3
4B

```

I just want to rename my files with the order of file names in txt file. Number of lines in the txt can be more or less. It should just stop renaming when it comes to end of lines. How to do that?