Dear all,
I'm new in this forum and also in the AWK Programming and need your help for the following Task:
I need to write an awk script that can be executed in either Windows XP or Windows 7 to parse such a message to extract the following data and write it to a comma-separated value format in this format:
Datetime Value, DATA_1, DATA_2, DATA_3
awk script that will take as its input file an email message that is now automatically generated and sent to me every hour.
Input File:
SQL*Plus: Release 11.2.0.2.0 Production on Thu Jul 12 10:33:01 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SQL> Connected.
SQL> SQL> SQL> SQL> DATA_1
SQL> 2 55555
SQL> DATA_2
SQL> 2 11111
SQL> DATA_3
SQL> 2 22222
So here is what the output text file that should result from running the awk script against the sample message:
Wed Jul 10:33:01 2011 , 555555, 111111, 222222
The Datetime Value is extracted from the tail of the first line of the message body.
I need also to enhance this solution by providing a command button in Outlook I can use, once I highlight such a message, that will execute the awk script against the highlighted message and produce a CSV text file in a separate Notepad window rather than having to deal with a CMD window.
I'm new in this forum and also in the AWK Programming and need your help for the following Task:
I need to write an awk script that can be executed in either Windows XP or Windows 7 to parse such a message to extract the following data and write it to a comma-separated value format in this format:
Datetime Value, DATA_1, DATA_2, DATA_3
awk script that will take as its input file an email message that is now automatically generated and sent to me every hour.
Input File:
SQL*Plus: Release 11.2.0.2.0 Production on Thu Jul 12 10:33:01 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SQL> Connected.
SQL> SQL> SQL> SQL> DATA_1
SQL> 2 55555
SQL> DATA_2
SQL> 2 11111
SQL> DATA_3
SQL> 2 22222
So here is what the output text file that should result from running the awk script against the sample message:
Wed Jul 10:33:01 2011 , 555555, 111111, 222222
The Datetime Value is extracted from the tail of the first line of the message body.
I need also to enhance this solution by providing a command button in Outlook I can use, once I highlight such a message, that will execute the awk script against the highlighted message and produce a CSV text file in a separate Notepad window rather than having to deal with a CMD window.