Hi,
I'm very new to UNIX scripting and find quite difficult to understand simple UNIX syntax. Really appreciat if somebody could help me to give simple codes for my below problems:-
1) I need to search for a string "TTOH 8031950001" in a files which filename will be "*host*'. For example, the string I searceh found in below line:-
<Jun 30, 2010 5:06:59 PM GMT+08:00> <DEBUG> <MessageFormatter> {F5380112-1890-3589-1A9E-7F135D382013} sending [ CAMSTTOH
TTOH 8031950001 53020001706590000 000001 6 009 21403500125671 ENG AUN CHAN Y 00257600006 ENG AUN CHAN 3445456567 ANANDA KRISHNAN N 100002322 20100630 N N 000000000200000 000000000000200 000000000200200 10125 CAMS21301000007960 10063002024620002 N 000000000000000 ]
(Please consider above is in a single line)
2) The line is too long. I just need Item in the position 2 to 14, Items in {}, sending until end of line.
Jun 30, 2010 F5380112-1890-3589-1A9E-7F135D382013 sending [ CAMSTTOH TTOH 8031950001 53020001706590000 000001 6 009 21403500125671 ENG AUN CHAN Y 00257600006 ENG AUN CHAN 3445456567 ANANDA KRISHNAN N 100002322 20100630 N N 000000000200000 000000000000200 000000000200200 10125 CAMS21301000007960 10063002024620002 N 000000000000000 ]
Then, it will be in a formatted text file.
Anyone can help to come out with a script?
Thanks in advance..
Note:-
1)I attached sample of files to be search - batch-host.log.6
2)I attached sample expected output file.
Compressed in a sample.zip file