Go4Expert

Go4Expert (http://www.go4expert.com/)
-   JavaScript and AJAX (http://www.go4expert.com/forums/javascript/)
-   -   VB Script needed: converting logs columns to rows (http://www.go4expert.com/forums/vb-script-converting-logs-columns-rows-t17348/)

fono 5May2009 12:08

VB Script needed: converting logs columns to rows
 
Hi all, i have a bunch of log files that needs to be imported into a database for analysis but the logs comes in the following format:

****************************CDR 1****************************
CDR_TYPE: CallRec
callingNumber: 7590405
calledNumber: 7500820
answerTime: 00:03:39
releaseTime:00:07:34
callDuration: 235
************************************************** ***********

****************************CDR 2****************************
CDR_TYPE: MOSMSRecord
serviceCentre: (91)685750004
recordingEntity: (91)685750007
location: (LAC: 00 0A CELLID: 75 49)
messageReference: 31
originationTime: 2007-09-01 00:07:34 - 0B00
destinationNumber: (91)6857513394
************************************************** ***********

****************************CDR 3****************************
CDR_TYPE: CallRec
callingNumber: 7583021
calledNumber: 7552525
answerTime: 00:04:39
releaseTime: 00:07:37
callDuration: 178
************************************************** ***********

I need a script to output data in rows insted of columns filtering only data of CDR_TYPE: CallRec
Bottom line is, you just need to see if the call is of type "CallRec" & print out every line after the first ':' until you see a bunch of '*', then start over


The output should be :

CDR_TYPE callingNumber calledNumber answerTime releaseTime callDuration
CallRec 7590405 7500820 00:03:39 00:07:34 235
CallRec 7583021 7552525 00:04:39 00:07:37 178
......


Thanks in advance
fono

shabbir 5May2009 14:55

Re: VB Script needed: converting logs columns to rows
 
Moved to VBScript forum


All times are GMT +5.5. The time now is 14:10.