I have to find the filename available in a folder with each file line count. And then, i will have kind of two column data.
Now i have to insert this record into a orac
I do not know Oracle, but it appears that the SQL syntax is quite similar to MySQL.
In essence you, you would do what you have done here with one minor change.
wc -l *| egrep -v " total$" | awk '{print $2 "|" $1}' > output.txt
You would write an SQL script called thesql.sql
that would look like the following:
LOAD DATA
INFILE output.txt
INTO TABLE yourtable
FIELDS TERMINATED BY '|'
(col1, col2)
Then, in your script (this is where I am hazy), have a line like this:
sqlplus /@ @thesql.sql
I found some help from a couple of different sources - here and here.
Hope this helps!