awk help..string display


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting awk help..string display
# 1  
Old 05-15-2009
awk help..string display

Dear All

I had input file as mention below.

<RXMFP:MO=RXOTX-46-5;
RADIO X-CEIVER ADMINISTRATION
MANAGED OBJECT FAULT INFORMATION

MO BTSSWVER
RXOTX-46-5 ERA-G04-R11-V01

RU RUREVISION RUSERIALNO
0

RUPOSITION RULOGICALID


STATE BLSTATE INTERCNT CONCNT CONERRCNT LASTFLT LFREASON
NOOP BLO 00000

FAULT CODES CLASS 1B
4

FAULT CODES CLASS 3c
4

From this i want below output.

RXOTX-46-5 1B4...........1st filed is mention under MO and second is again FAULT CODES CLASS. I want only 1st fault code. 2ed fault (3c4 not required. ).

Kindly suggest me possible ways.

regarda
jaydeep
# 2  
Old 05-15-2009
what have you learnt from this thread ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Search a string and display its location on the entire string and make a text file

I want to search a small string in a large string and find the locations of the string. For this I used grep "string" -ob <file name where the large string is stored>. Now this gives me the locations of that string. Now how do I store these locations in a text file. Please use CODE tags as... (7 Replies)
Discussion started by: ANKIT ROY
7 Replies

2. Shell Programming and Scripting

Display Additional Variable string in awk print command

Hi all, I have script to monitor and sum up the total memory use up for each individual process. proc=$1 svmon -P -O summary=basic,unit=MB|awk 'NR>4'|grep -w "${proc}" |awk '{sum+=$3} END {printf "\t" sum """\n";}' But I would like the script to be able to display as following ... (3 Replies)
Discussion started by: ckwan
3 Replies

3. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

4. Shell Programming and Scripting

Search a String and display only word.

Hello Gurus, Apologies if this Q has been repeated but i was not able to find it :( I have an input file: ------------------------------- Replace DB.Employee as select column1 column2 from DB_T.Emp and DB.Test and DB.Dept and DB_T.Ter; ------------------------ (4 Replies)
Discussion started by: indrajit_u
4 Replies

5. Shell Programming and Scripting

Display the string issue

Hi, i ran following bdf command and found below out with space uses. prd@prd02/usr/apps/cti>bdf | grep /usr/apps /dev/vg01/lvol6 17379328 9873783 7036696 58% /usr/apps /dev/vg01/SYBASE 1228800 978631 234597 81% /usr/apps/sybase 2150400 1108516 976776 ... (3 Replies)
Discussion started by: koti_rama
3 Replies

6. Shell Programming and Scripting

Display string at line number

I have a code here , which should display lines 6,10,14,18,35 of a text file #!/bin/ksh line=6 line=10 line=14 line=18 line=35 for i in 1 2 3 4 5 do val=`echo ${line}` act=`awk 'NR~/^($val)$/' db_CHECKOUT.txt` done; This code is not working. The purpose of the line below is... (3 Replies)
Discussion started by: njafri
3 Replies

7. Shell Programming and Scripting

Display of string with TAB in it

Hi, I am having trouble using the result of the following awk command in a script, as displaying the contents of the placeholder automatically replaces the new created TAB by a space character again: From the prompt: cscyabl@comet:(develop)> echo "01 12" | awk '{gsub(" ","\t");print}' 01 ... (2 Replies)
Discussion started by: Indalecio
2 Replies

8. Shell Programming and Scripting

how to display only last character of a string?

hi all, if i do an: "echo $string |" what should be after the pipe to display ONLY the last char of the output? tia, DN2 (9 Replies)
Discussion started by: DukeNuke2
9 Replies

9. Shell Programming and Scripting

Search for string and display those NOT found

In my script I read a input file and search all the files in a directory and it's sub-directories for that string using: find . -type f -print | xargs grep $var1 This just displays all the lines the string was found on. Too much data. What I need is to store in a file one time those... (17 Replies)
Discussion started by: John Rihn
17 Replies

10. Shell Programming and Scripting

Display only found string

Is there a way for grep to output only the found string and not the whole line? I have a ksh script which reads in a file and loops through every line looking up on a grep -f list. For it to only display only the string found i pass this to awk as a variable and loop through the list file using... (5 Replies)
Discussion started by: Cranie
5 Replies
Login or Register to Ask a Question