I like this solution - I'm not very used to using "cut" - or more generally to map from "files" to "fields/lines in a text stream".
I'm more inclined to ask:
given a list of files with this name, does a file of a different name exist on the file system?
But the more Unix approach is really:
how can I model my data as a text stream, and how can I then pose/answer my question?
(here: list all filenames in folder in sorted order - cut away the text indicating type - then count/display the non-repeat/single entries)
My solution would probably be more like (with bash in mind, most of this could be "expanded" to fork out to more utils, like "basename -s" etc) :
for data_file in *_data.csv
do;
alg_file="${data_file%_data.csv}_A.csv";
if [[ ! -f "${alg_file}" ]];
then
echo "Missing alg file:\
${alg_file} for data \
file: ${data_file}";
fi;
done