Sponsored Content
Top Forums Shell Programming and Scripting Grep in file and print in the line Post 302861197 by RavinderSingh13 on Tuesday 8th of October 2013 11:02:19 AM
Old 10-08-2013
Hi,

Let us say our data is in a file named get_exact_output.
Could you please use the following code.

Code:
awk '$NR==1 || /Date/ {next} sub(":",X) sub("=",Y) {print"20131008 1515 "$1 $2 " "$3}' get_exact_output

Output will bee as follows.

Code:
20131008 1515 SaxxProc_m0_s13 1640
20131008 1515 SaxxProc_m0_s15 1791
20131008 1515 SaxxProc_m0_s17 1644
20131008 1515 SaxxProc_m0_s19 1599
20131008 1515 SaxxProc_m0_s21 1715
20131008 1515 SaxxProc_m0_s23 1686
20131008 1515 SaxxProc_m1_s1 1632
20131008 1515 SaxxProc_m1_s3 1712
20131008 1515 SaxxProc_m1_s5 1574
20131008 1515 Saxx_SYSTEM 14993
20131008 1515 SaxxProc_m0_s13 1864
20131008 1515 SaxxProc_m0_s15 1766
20131008 1515 SaxxProc_m0_s17 1739
20131008 1515 SaxxProc_m0_s19 1845
20131008 1515 SaxxProc_m0_s21 1941
20131008 1515 SaxxProc_m0_s23 1841
20131008 1515 SaxxProc_m1_s1 1780
20131008 1515 SaxxProc_m1_s3 1810
20131008 1515 SaxxProc_m1_s5 1720
20131008 1515 Saxx_SYSTEM 16306



Thanks,
R. Singh
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

print a line containing word in a column using grep

hi, how to print a row which contains a perticular word in its third column using grep, cut, or any thing else. thanks (2 Replies)
Discussion started by: useless79
2 Replies

2. Shell Programming and Scripting

Awk+Grep Input file needs to match a column and print the entire line

I'm having problems since few days ago, and i'm not able to make it works with a simple awk+grep script (or other way to do this). For example, i have a input file1.txt: cat inputfile1.txt 218299910417 1172051195 1172070231 1172073514 1183135117 1183135118 1183135119 1281440202 ... (3 Replies)
Discussion started by: poliver
3 Replies

3. Shell Programming and Scripting

grep N lines after match and then print them on 1 line each

Hello I need some help with this job. file.txt ----- cut ---- TARGET 13/11/08 20:43:21 POINT 1 MOVE 8 772102y64312417771 TARGET 13/11/08 21:10:01 POINT 2 MOVE 5 731623jjd12njhd ----- cut ---- this is the example. i need to grep for the word TARGET and print next 4 lines like... (1 Reply)
Discussion started by: alekkz
1 Replies

4. UNIX for Dummies Questions & Answers

grep N lines after match and then print them on 1 line each

Hello I have a silly question. I need to grep a match in text file and then print 5 lines after it. grep -A 5 .... do it. OK The next thing I can not handle is I need each output to be on 1 line match line2 line3 line4 line5 match line2 line3 line4 line5 etc.. I will really... (10 Replies)
Discussion started by: alekkz
10 Replies

5. Shell Programming and Scripting

Find a string using grep & print the line above or below that.

Hi All, Please tell me how can I Find a string using grep & print the line above or below that in solaris? Please share as I am unable to use grep -A or grep -B as it is not working on Solaris. (10 Replies)
Discussion started by: Zaib
10 Replies

6. Shell Programming and Scripting

grep a string and print strings on that line

i have a file like below ABS 12234 A C 12G CFY 23865 A C 34D i want to grep "A C" then print ABS 12G 12234 CFY 34D 23865 Thanks! (4 Replies)
Discussion started by: kingpeejay
4 Replies

7. Shell Programming and Scripting

grep based on pattern in a line and print the column before that

$ cat file.log Message Number = : Sending message 10:50:16^|^reqhdr.dummyid^=^02^|^reqhdr.timezone^=^GMT+05:30^|^DUMMYREQUEST^=^BH||||||||||||||||||$BD|OL|C|V||DummyAcctNo|02||24/12/2011|ST_DDM|DDM||||||||reqUUID110612105016$BT||||||||||||||||||$] Length I have the above line in the... (4 Replies)
Discussion started by: kalidass
4 Replies

8. Shell Programming and Scripting

Grep or print each section of a file on one line with a separator

I can obtain information from itdt inventory command however it display as below, I'd like to print each entity on one line but seperated by : the file is something like and each section ends with Volume Tag Drive Address 256 Drive State ................... Normal ASC/ASCQ... (3 Replies)
Discussion started by: gefa
3 Replies

9. UNIX for Dummies Questions & Answers

Grep file and print value only if the following line doesnt contain value xxxx

Hi All, I have some large files which I would like to obtain some data from, I want to grep (or alturnative method) out certain values hut only if the folowing line doesnt contain a certain value. I will explain better below showing an example print of the data. NE : V0001 NE : V0002... (6 Replies)
Discussion started by: mutley2202
6 Replies

10. Shell Programming and Scripting

Grep echo awk print all output on one line

Hello, I've been trying to find the answer to this with Google and trying to browse the forums, but I haven't been able to come up with anything. If this has already been answered, please link me to the thread as I can't find it. I've been asked to write a script that pulls a list of our CPE... (51 Replies)
Discussion started by: rwalker
51 Replies
PCCBB(4)						   BSD Kernel Interfaces Manual 						  PCCBB(4)

NAME
pccbb -- cardbus bridge driver SYNOPSIS
device cbb device pccard device cardbus device exca DESCRIPTION
The pccbb driver implements the Yenta specification for CardBus bridges. The following PCI cardbus and pcmcia bridges are supported: Cirrus Logic PD6832 Cirrus Logic PD6833 Cirrus Logic PD6834 O2micro OZ6812 O2micro OZ6832 O2micro OZ6833 O2micro OZ6836 O2micro OZ6860 O2micro OZ6872 O2micro OZ6912 O2micro OZ6922 O2micro OZ6933 O2micro OZ6972 O2Micro OZ711E1 O2Micro OZ711M1 Ricoh RL4C475 Ricoh RL4C476 Ricoh RL4C477 Ricoh RL4C478 TI PCI-1031 TI PCI-1130 TI PCI-1131 TI PCI-1210 TI PCI-1211 TI PCI-1220 TI PCI-1221 TI PCI-1225 TI PCI-1250 TI PCI-1251 TI PCI-1251B TI PCI-1260 TI PCI-1260B TI PCI-1410 TI PCI-1420 TI PCI-1450 TI PCI-1451 TI PCI-1510 TI PCI-1515 TI PCI-1520 TI PCI-1530 TI PCI-1620 TI PCI-4410 TI PCI-4450 TI PCI-4451 TI PCI-4510 TI PCI-4520 TI PCI-[67]x[12]1 TI PCI-[67]x20 ENE CB710 ENE CB720 ENE CB1211 ENE CB1255 ENE CB1410 ENE CB1420 Toshiba ToPIC95 Toshiba ToPIC95B Toshiba ToPIC97 Toshiba ToPIC100 TUNABLES
The driver supports the following tunable parameters, which may be added to /boot/loader.conf or set via the sysctl(8) command: hw.cbb.debug Non-zero values cause more verbose information to be printed to aid in debugging problems with the bridge chipset. SEE ALSO
cardbus(4), pccard(4), exca(4) BSD
July 21, 2004 BSD
All times are GMT -4. The time now is 06:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy