I have a long log file (abc.log) which contains large volume of data that need to be inserted into the database as clob.
I am having problem in inserting the long log file into the clob field if the cahracters in the file exceeds. So iwould like to truncate the file upto 32767 characters and append a string at last "Log file to large to view go to server".
Are there lines of output in the log so the file can be read by awk?
awk ' BEGIN {rec="" }
{ if length(rec)> 32767) {next};
rec=sprintf( "%s\n", $0)
}
END { if (length(rec) > 32767) {rec=substr(rec,1,32767)}
print rec, "Log file to large to view go to server"
}' input_logfile > newfile