Hi,
I have two files, say file_A and file_B
# cat file_A
[30/Jan/2004:17:43:11 user1
[30/Jan/2004:17:58:37 user2
...
..
# cat file_B
1.1.1.1 - - [30/Jan/2004:17:43:11 "dom.com/logon_main.jsp"
1.1.1.1 - - [30/Jan/2004:17:43:11 "dom.com/logon.do"
6.6.6.6 - - [30/Jan/2004:17:43:11 "dom.com/something1.jsp"
2.2.2.2 - - [30/Jan/2004:17:50:37 "dom.com/something1.jsp"
3.3.3.3 - - [30/Jan/2004:17:51:41 "dom.com/path/something2.jsp"
4.4.4.4 - - [30/Jan/2004:17:52:41 "dom.com/path/something2.jsp"
5.5.5.5 - - [30/Jan/2004:17:58:37 "dom.com/"logon_main.jsp"
5.5.5.5 - - [30/Jan/2004:17:58:37 "dom.com/logon.do"
...
..
I want to have an output from the Two precedent files like this :
1.1.1.1 - user1 [30/Jan/2004:17:43:11 "dom.com/logon_main.jsp"
1.1.1.1 - user1 [30/Jan/2004:17:43:11 "dom.com/logon.do"
6.6.6.6 - - [30/Jan/2004:17:43:11 "dom.com/something1.jsp"
2.2.2.2 - - [30/Jan/2004:17:50:37 "dom.com/something1.jsp"
3.3.3.3 - - [30/Jan/2004:17:51:41 "dom.com/path/something2.jsp"
4.4.4.4 - - [30/Jan/2004:17:52:41 "dom.com/path/something2.jsp"
5.5.5.5 - user2 [30/Jan/2004:17:58:37 "dom.com/"logon_main.jsp"
5.5.5.5 - user2 [30/Jan/2004:17:58:37 "dom.com/logon.do"
...
..
In other words, what I want is whenever the dates and times in the two
files (file_A and file_B) are the same (1st field in file_A is equal to
the 4th field in file_B) AND that the 5th field in file_B contains
logon_main.jsp OR logon.do, I have to REPLACE the 3rd field in the
file_B (-) with the 2nd field in the file_A (the user) .
How to acheive this ?
Please help.
Best Regards.
haed98