line count with in the text files having multiple lines and single lines

前端 未结 3 719
伪装坚强ぢ
伪装坚强ぢ 2021-01-28 14:47

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

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-28 15:21

    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 ))

提交回复
热议问题