Sponsored Content
Top Forums Shell Programming and Scripting Extract Specific Information from a particular field Post 302945635 by rramkrishnas on Monday 1st of June 2015 06:51:43 AM
Old 06-01-2015
Extract Specific Information from a particular field

Hi,

I am trying to extract a specific information from a file which contains more than 200 million records. Attached the input file for your reference.

My file contains information below
Code:
HGSDC:MSISDN=917807000032,SUD=CAT-10&DBSG-1&BS3G-1&TS11-1&TS21-1&TS22-1&RSA-1&DCSIST-0&GPRSCSIST-0&MCSIST-0&OCSIST-1&OSMCSIST-1&TCSIST-1&VTCSIST-0&CSP-6&NAM-0&TSMO-0&SCHAR-4&PWD-0000&OFA-0&OICK-50&HOLD-1&MPTY-1&CLIP-1&CFU-1&CFB-1&CFNRY-1&CFNRC-1&BAOC-1&CAW-1&SOCFU-1&SOCFB-1&SOCFRY-1&SOCFRC-1&SODCF-0&SOSDCF-4&SOCB-0&SOCLIP-0&SOCLIR-0&SOCOLP-0;

I need to extract only CSP information which is highlighted in green color above.

Currently I am extracting by using Grep individual CSP value and then appending into a single file, which is taking more time and also required more manual exercise.

Would need your help to get simple script without much manual process.

Thanks
Ram
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How do you extract the information from a library?

hi all, i am quite new with Perl (just 1 week of experience) and i am suppose to understand the usage of library, which i can't, anyway... i came across this library...i think from the linux redhat redhat.linux.lib.pl, there are a couple of functions there that can be used to retrieve information... (3 Replies)
Discussion started by: mercz
3 Replies

2. Shell Programming and Scripting

modify a few field of the record information

Hello, I have the following record in a text file, i would like modify some field: 1 - remove all space between ",", but the company name of word will not delete. Anyway, I can use the following statement to do it. 's/^ *//;s/ *, */,/g;s/ *$//' file 2. field #12, I need to modify to time... (11 Replies)
Discussion started by: happyv
11 Replies

3. HP-UX

extract field of characters after a specific pattern - using UNIX shell script

Hello, Below is my input file's content ( in HP-UX platform ): ABCD120672-B21 1 ABCD142257-002 1 ABCD142257-003 1 ABCD142257-006 1 From the above, I just want to get the field of 13 characters that comes after 'ABCD' i.e '120672-B21'... . Could... (2 Replies)
Discussion started by: jansat
2 Replies

4. Shell Programming and Scripting

Problem in getting the ps information with field separator

Dear all I have the following problem that want to have your advices. I want to capture the `ps auxwww | head -30` image with field separator (|) in my script My expect output USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND root | 774 | 18.5 | 0.0 | 12 | 19716 | - |... (5 Replies)
Discussion started by: on9west
5 Replies

5. Shell Programming and Scripting

Extract data into file with specific field specs

:confused: I have a tab delimited file that I need to extract data from and into a file with specific field specs. Each field has to be a certain amount of characters. So, the name field (from delimited file) might have only 15 characters but needs to be 25 (in new file) so I need to insert spaces... (5 Replies)
Discussion started by: criddel
5 Replies

6. Shell Programming and Scripting

Replace specific field on specific line sed or awk

I'm trying to update a text file via sed/awk, after a lot of searching I still can't find a code snippet that I can get to work. Brief overview: I have user input a line to a variable, I then find a specific value in this line 10th field in this case. After asking for new input and doing some... (14 Replies)
Discussion started by: crownedzero
14 Replies

7. UNIX and Linux Applications

Reflection Macro: Use Current Date Information in specific field of report

Hi Everyone, New to the forum, and have my first question. I have the following Macro currently being used within Telnet to run a report for the date being entered. However, now I need the Macro to input the day after today to the the day after today. Example: If today is May 9, 2012 - the... (0 Replies)
Discussion started by: CipherEffect
0 Replies

8. Shell Programming and Scripting

How to print with awk specific field different from specific character?

Hello, i need help with awk. I have this file: cat number DirB port 67 er_enc_out 0 er_bad_os 0 DirB port 71 er_enc_out 56 er_bad_os 0 DirB port 74 er_enc_out 0 er_bad_os 0 DirB port 75 ... (4 Replies)
Discussion started by: elilmal
4 Replies

9. Shell Programming and Scripting

How to extract specific information?

hi, i have a file A like this: ******************* No 2823 ******************** contig15205- G383C4U02H4G80+ is in contig15205- G383C4U02HGLXM- is in contig15205- G383C4U01C3HIZ+ is in contig15205- ... (3 Replies)
Discussion started by: the_simpsons
3 Replies

10. Shell Programming and Scripting

Extract information from file

In a particular directory, there can be 1000 files like below. filename is job901.ksh #!/bin/ksh cront -x << EOJ submit file=$PRODPATH/scripts/genReport.sh maxdelay=30 &node=xnode01 tname=job901 &pfile1=/prod/mldata/data/test1.dat ... (17 Replies)
Discussion started by: vedanta
17 Replies
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 09:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy