Hi, Please read the whole thread.
I have been working on this script below. It works fine, feel free to copy and test with the INPUT File below as well.
example:
Code:
PACKET DATA PROTOCOL CONTEXT DATA
APNID PDPADD EQOSID VPAA PDPCH PDPTY PDPID
10 8 NO 8-0 IPV4 1
1 8 NO 8-0 IPV4 2
2 8 NO 8-0 IPV4 3
END
What I need to get is the first column between the pattern
PACKET DATA PROTOCOL CONTEXT DATA and
END
thanks Chubler_XL for taking your time and help me out with this.
Unfortunately, the input file is a little bit tricky. It seems that is trying to look for the numbers, but only displays the placeholder and not the value.
I have been playing around with the values of RSTART and RLENGTH with no luck. Any suggestion?
Chubler_XL
Man that was awesome, It worked really cool.. Thanks again for your time and bearing with me this script!!!!
Saludos.
---------- Post updated at 07:54 AM ---------- Previous update was at 07:37 AM ----------
One more help, Last time I did not realize about some categories might display several times in the input file. For example, category BAOC, it has 4 occurrences, so I need to extract that category and the column beside called STATUS separated by commas
hgsdp:msisdn=50767807532,all;
HLR SUBSCRIBER DATA
SUBSCRIBER IDENTITY
MSISDN IMSI STATE AUTHD
50767807532 714011000643614 CONNECTED AVAILABLE
NAM
0
PERMANENT SUBSCRIBER DATA
SUD
CAT-10 DBSG-1 TSMO-0 OBR-2
OSB4-1 TS11-1 TS21-1 TS22-1
BS2G-1 BS3G-1 REDMCH-1 OFA-1
PWD-0000 EMLPP-1 DEMLPP-5 MEMLPP-5
OICK-24 TICK-11 CFU-1 BAOC-1
BOIC-1 BOIEXH-1 BAIC-1 BICRO-1
CAW-1 SOCFU-0 SOCB-1 SOCLIP-0
SODCF-0 SOSDCF-7 HOLD-1 MPTY-1
CLIP-1 RED-1
SCHAR-8-0
SUPPLEMENTARY SERVICE DATA
BSG
TS10
SS STATUS FNUM TIME
SADD
BAIC NOT ACTIVE
BAOC NOT ACTIVE
BSG
TS20
SS STATUS FNUM TIME
SADD
BAIC NOT ACTIVE
BAOC NOT ACTIVE
BSG
BS20
SS STATUS FNUM TIME
SADD
BAIC NOT ACTIVE
BAOC NOT ACTIVE
BSG
BS30
SS STATUS FNUM TIME
SADD
BAIC NOT ACTIVE
BAOC NOT ACTIVE
Example:
I have files in below format
file 1:
zxc,133,joe@example.com
cst,222,xyz@example1.com
File 2 Contains:
hxd
hcd
jws
zxc
cst
File 1 has 50000 lines and file 2 has around 30000 lines :
Expected Output has to be :
hxd
hcd
jws (5 Replies)
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Hi! Is there a way to append column and row header to a file in awk script.
For example if I have
Jane F 39 manager
Carlos M 40 system administrator
Sam F 20 programmer
and I want it to be
# name gend age occup
1 Jane F 39 manager
2 Carlos M ... (4 Replies)