How to get total records loaded from sqlldr log file

Hi,

I am loading data in the database table through sqlldr. I have to find total records loaded from sqlldr log file and store it in a variable in my script. How do I get it?

Thank you.

I remember but not sure, in sqlloader log, For successfully loaded, it shows a row something like

 n Rows successfully loaded.

you can grep this row.

RecordsLoaded=$(grep 'Rows successfully loaded' logfile | awk '{print $1}')

I assume you are creating log file each time you load the records.

yes I am creating log file each time I loaded records. In log file we got one line viz.

Table ACCOUNT_DETAILS: 1000 rows successfully loaded.

I will try your code and see if i am getting desired output or no.
Thanks.

In log file the line may be either way. I will double check and try your code. Thanks.
Table ACCOUNT_DETAILS: 1000 rows successfully loaded.
or
Table ACCOUNT_DETAILS:
1000 rows successfully loaded.

If this is your row, then replace "$1" with "$2".

I had thought the log like the below,

Table ACCOUNT_DETAILS:
1000 rows successfully loaded.

also, Rows --> rows.

so now it will be like this,

RecordsLoaded=$(grep 'rows successfully loaded' logfile | awk '{print $2}')