What I have to do is, pick the values from (say in the first line)
60173054304,100232120,20091112091359, till the character ';'
and insert them into the database (a table).
The advantage (I guess) is that the values always start from the 42nd character of each line. I have to pick the line till I confront the character ';'. Then I have to divide that string into different fields delimited by a comma (','). Can somebody help me out on this.
I require a code to list all the files that have the extension "log" in a folder and then I have to process each of them, reading each line in the file and insert the contents of the file into the database. I tried searching for a similar query in the forum but cudn't find any. Kindly help me on this. One more condition is that the code has to pick the files that got accumulated today (only today) and then process them for the contents. The file name will have the time stamp appended. Thanks in advance.
Now I am trying to read the file line by lline and assign the fields to variables using awk.
say
v=echo `awk -F"," '{print $4}' tmpline.log`
tmpline.log is the temporary line from the file
I have to use these variables to be passed onto an sql procedure. The problem here is, if one of the fileds in the line is a null value then the variable has to be assigned the value 'NULL'.
How to do this?
---------- Post updated at 04:34 PM ---------- Previous update was at 04:00 PM ----------