Script fro file check and load the trail file

Hi,

Im going to use shell script for load the data into DB.

First i need to read the trail file(csv file has two columns with comma separated ) like file name trail1024(last 4 digitsMMDD).

In this trail file 27 entries will have like below,I need to read first csv file name and get the 4 digit number(ex 1024 from file name below) from file name and need to keep the variable.

abcd1024.csv,23
defg1024.csv,55
....

Then i need to loop through the all files names from tail file and need to check the all file are exists or not in directory.
If any file is not found in directory need to exist from shell script and throw error.

If files are exists i need to call oracle function called loaddata .

Please help on this shell scripts

Any attempts/ideas/thoughts from your side? Any preferred tools?