so far what i did was awk the file1.txt
list=`awk -F "|" '{print $1$2}' file1.txt`
i don't know if read line is the correct code
while read line
do
ls PROS$list*
<i don't know next if there's a non matching file how do i print it.>
Those "PROS" files are listed and piped into awk , which collects them into the T array. Then file1 is read and each line's values compared against the indices of the T array. If not found, "PROS" plus the values are printed.
substr() is a built-in function in AWK, to extract a consecutive sequence of characters from inside a string.
substr($1, 5, 7) extracts from field 1, 7 characters, starting at character 5.
NR == FNR ## Apply the action to only the lines from first file
{T[substr($1, 5, 7)] = $1;...} ## Create an associative array which index is the return from substr(), and the value is the first field.
{...; next} ## Skip to next line
!($1$2 in T) ## execute {...} for any line from second file if the concatenation of field one and two is not an index found in the associative array T.