i am using UTL_FILE
utility in oracle to get the data in to csv file. here i am using the script.
so i am getting the set of text files
case:1
In your second example your lines do not start with "
followed by a number. That's why count is 0
. You can try egrep -c "^\"([0-9]|\")"
to catch empty first column values. But in fact it might be simpler to count all lines and remove 1
because of the header row.
e.g.
count=$(( $(wc -l test.csv) - 1 ))