To Search for a pattern and substring text in a file

view story

http://www.unix.com – I have the following data in a text file. Code: "A",1,"MyTextfile.CSV","200","This is ,line one" "B","EFG",23,"MyTextfile1.csv","5621",562,"This is ,line two" I want to extract the fileNames MyTextfile.CSV and MyTextfile1.csv. The problem is not all the lines are delimited with "," There are few lines delimited with only , Also, the column of the filenames is not constant. To put it in simple words, I want to extract the text ending with either .csv or .CSV Please Help. Mode (HowTos)