Help regarding the delimiter

Hi,

I am trying to load data from a file to oracle DB. The file am using has a ";" as a delimiter. While I load the file, I want to check whether the file is having the correct delimiter or not. if not, the file should not be processed. Is there any way that i could handle this scenario using shell Script. Can anyone please help me.

Thanks in advance..

Can you post sample input files with correct and incorrect delimiter?

Do these files have lots of fields? You can ignore files that don't have enough apparent fields...

if ! awk -F";" '{ exit (NF<3) }' filename
then
        echo "File has less than 3 fields" >&2
        exit 1
fi

Hi,

for Example, If I am using Text.csv file. and I have 10 fields on that which are seperated with ";" delimiter. I should process the file. The file having any delimiter like ",", "." "||" anything other than ";" should not be processed. Hope you underatand the scenario.

Thanks.