Here I need to get the 1st line with table and column detail and second line for the error String. There are hundreds of the same error like this in my file ....so I need the count of the error for a particular error on table.column and the unique {error message} with table.column details.
awk '{x=$0; ###### Taking complete line into a variable named x
getline; ###### getline is an awk keyword to move the cursor to next line.
x=x"\n"$0; ###### taking value of variable named x with it's previous value and then new line and then complete line($0).
a[x]++} ###### Here creating an array named a whose index is x and incrementing it's each occurances too.
END{ ###### starting END section here.
for (i in a){ ###### starting a for loop in array named a
print i, a, "rows"} ###### here once we get into array a then printing the value of vafriable i, value of array a as a(which is nothing but count of rows) and string rows then.
}' file ###### calling Input_file here.
Thanks a lot Ravinder. One more question.
My file is a sqlldr log in which many other msg and content is there.
Actually I was getting the exact msg which contain only error by below command(that msg content is in my first question)
From this command I am getting my desired error messages which i was initially redirecting to a file and then the awk function will use it to give me error count with error msg.
Now I don't want to create a separate file and want to directly pass the strings to the awk function. How I can do that.