• 1 reply
  • Latest Post - ‏2013-06-24T16:40:51Z by GarlandJoseph
1 Post

Pinned topic Select data from log

‏2013-06-06T01:24:52Z |

Hi all,

I have the log file.

(13:55:54:39878 ) : Send : [A]Login [34=0SOH2=KTSSKSOH49=NEWTUOMMSOH333=NHHHHH]
(13:55:55:15228 ) : Send : [A]Login[34=0SOH2=KTSSKSOH49=NEtrtrtrttrttrSOH333=Nggrgrg]
(13:55:56:37778 ) : Send : [A]Login[34=0SOH2=KTSSKSOH49=trtrtrtrtrrtttMSOH333=N545455]
(13:55:57:33338 ) : Send : [A]Login[34=0SOH2=KTSSKSOH49=NE54ghthtMMSOH333=N444444]
I want to get this data (tab time and tab 49)
(13:55:54:39878 )SOHNEWTUOMM
(13:55:55:15228 )SOHNEtrtrtrttrttr
(13:55:56:37778 )SOHtrtrtrtrtrrtttM
(13:55:57:33338 )SOHNE54ghthtMM
How to do that? what command ?

Updated on 2013-06-06T01:29:41Z at 2013-06-06T01:29:41Z by meomeomeo87
  • GarlandJoseph
    167 Posts

    Re: Select data from log


    This looks like a simple parsing issue that can be solved with either awk or cut.  I cut and pasted your text and was going to parse it however, the organization of the data you posted is unclear.  For example, I don't think the above output shows the actual end of lines.  When I cut and pasted it even appeared that a portion of the lines are fixed...with the last field being variable.  Please attach a sample of the actual log file using the attach a file feature provided by this forum.