Hi guys, I am stuck up in a situation. I have a SUN box with certain logs which I need to parse to draw a report using Perl.
Now, when I load the text file using a perl degugger to see how the text looks like when the first line of the log file is read in a variable. below is the snapshot of first line read from the file. My usefull values are like ITS=20100620082137,409 cIOTS=20100620082137,691. It seems \c is the character which could be used as value seperator.
Code:
"ITS=20100620082137,409\cIOTS=20100620082137,691\cIUSER=untrustedapp\cIOP=GetSubscriptionStatus\cIRC=1000\cIMSISDN=966501237533\cISID=61\cIDATA_CLI={SUBSCRIPTIONTYPE=10}\cIDATA_RES=\cI\cI"
So, I tried to split the values using the split function but Its not working. Any idea about this "\c" char and how can I manage to split the text in my text file.
Code:
@values = split('\c', $item);
Moreover, when I cat my log file the /c char is not visible rather the values are seperated by spaces as below.
Code:
ITS=20100620102817,341 OTS=20100620102817,603 USER=untrustedapp OP=GetSubscriptionStatus RC=1000 MSISDN=966535468329