/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


how to filter out keyword values from a text file so that we can make excel sheet.... i have highlighted the values which i need in excel sheet

08/07/2014 2305 views
 FLAGS          : FIRST      CHARGE     ANSWER     CONN                 
 OWNER DN       : 1292433355                                            
 CALLING PARTY  : 1292433355                                            
 NADI: 3  =NATIONAL NUMBER        NPI: 1=ISDN NUMBERING PLAN 
 SCR.IND.: 3=NETWORK PROVIDED         PRES.IND.: 0=ALLOWED       
 CALLED PARTY   : 61434045186                                           
 NADI: 4  =INTERNATIONAL NUMBER   NPI: 1=ISDN NUMBERING PLAN 
 DATE TIME DURAT: 2011-09-05  08:55:08 0   ENDTIME SECURE       1194 SEC
 PARTNER DN     : 0061434045186                                         
 ZONE/CHARGEBAND: ZONE= 33   CHB=                                       
 CHARGE UNITS   : CONN= 200                         
 CONNECTION ID  : H'7D08282E   
0 Comments   [ + ] Show comments

Comments


All Answers

0
I would install grep for windows  http://gnuwin32.sourceforge.net/packages/grep.htm  or cygwin https://www.cygwin.com/

either way from the command prompt you can filter the text file and pull the lines you need

grep for windows
type filename | grep -i -e "owner dn" -e "date time durat" -e "partner dn" -e "zone/charge" -e "charge units" > newfile

cygwin
cat filename  | grep -i -e "owner dn" -e "date time durat" -e "partner dn" -e "zone/charge" -e "charge units" > newfile

either way newfile ends up with the highlighted data you were looking for.
| grep -i -e "owner dn" -e "date time durat" -e "partner dn" -e "zone/charge" -e "charge units" > newfile - See more at: http://www.itninja.com/question/how-to-filter-out-keyword-values-from-a-text-file-so-that-we-can-make-excel-sheet-i-have-highlighted-the-values-which-i-need-in-excel-sheet#sthash.qU2s26pA.dpuf
Answered 08/08/2014 by: genfoch01
Orange Senior Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ