Grep command supports regular expression. In the below example, it extracts the file name from the string. The -o prints only the matched part. The -E extends the regular expression support so it can use all the regex syntax. The '^\s*.+\.csv'' simply matches a string starts with 0 or more space (\s), and ends with .csv, with one or more of any character (.+) between.
echo ' ABC_EFG, 21 July 2017.csv A 575 Fri Jul 21 04:24:51 2017\n' | grep -oE '^\s*.+\.csv'