Did you post in the CODE BLOCK what is actually in your script, or did you edit it after posting?
there is a and in your pasted code which makes the script look for a filename containing the literal characters at the beginning and end of the filename

Also please give an example of the contents of your text file
Because when you use $read with the 's' switch, if there is a match with $6 it returns the remainder of the line excluding $6, so if that line contains only $6, then you will have a match with the if statement comparing against $Null