Process Beginning - 08-26-2010-23.41.47
DB2 CONNECTION SUCCESSFUL!
Ready to process and load file: FILENAME
# of rows in the TABLENAME table before inserts was 8364
FILENAME - RECORDS READ COUNT: 4838
FILENAME - INSERTED ROW COUNT: 129
FILENAME - ERROR RECORDS COUNT: 0
# of rows in the audit.ELIG_RESP_AUDIT table after inserts was 8493
Process Complete 08-26-2010-23.41.49

There are many instance like the above in a single file.I am able to open the file and read line by line. But, my requirement is to read the Process Beginning, INSERTED ROW COUNT: and Process Complete into three variables. The count should keep on adding between a process.

can anyone please help me with this?

i think i dont quite understand what you are trying to do... but heres my interpretation and how i would do it, using awk

awk '{if ($0 ~ "Process Beginning") {var1=$0;counter=0} else if ($0 ~ "Process Complete"){var2=$0;counter=0} else {counter=counter+1}}' file.txt

what this should do is:
- if the line contains "Process Beginning" set var1 as the line and reset the counter
- if the line contains "Process Complete" set var2 as the line and resset the counter
- if it doesnt contain either it increases the value of counter by 1

IM NOT DOING ANYTHING with those variables, and how you use them is up to you, but its a general idea

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.