Sponsored Content
Top Forums Shell Programming and Scripting Print whole line if variables matches Post 302975704 by RavinderSingh13 on Friday 17th of June 2016 10:10:43 AM
Old 06-17-2016
Hello nypreH,

I am not sure about your requirement as you are creating a new requirement in each post. Could you please try following and let me know if this helps.
Code:
awk 'FNR==NR{A[$2]=$0;next} {Q="["$1"]"} (Q in A){print A[Q]}' FS="_" featureCode1stPart  featureCodesAndCapacity

Output will be as follows.
Code:
[L3 functionality for ESB switch]_[1234]_Capacity^6^NBSC01 ^L3_functionality_for_ESB_switch
[Gb over IP]_[7]_Capacity^2100^NBSC01 ^Gb_over_IP
[EDGE BSS Fnc]_[4]_Capacity^1837^NBSC01 ^EDGE_BSS_Fnc
[GPRS CS3 and CS4]_[2]_Capacity^1816^NBSC01 ^GPRS_CS3_and_CS4
[Soft CH capa]_[14]_Capacity^2100^NBSC01 ^Soft_CH_capa
[AMR Capacity]_[1]_Capacity^1950^NBSC01 ^AMR_Capacity
[PCU2 app SW]_[13]_Capacity^68^NBSC01 ^PCU2_app_SW
[Flexi EDGE BTS Operating SW]_[73]_Capacity^898^NBSC01 ^Flexi_EDGE_BTS_Operating_SW
[STIRC]_[393]_Capacity^850^NBSC01 ^STIRC
[E-Cell GPRS]_[591]_Capacity^1000^NBSC01 ^E-Cell_GPRS
[Double Power TRX for 2G BTS]_[834]_Capacity^50^NBSC01 ^Double_Power_TRX_for_2G_BTS
[GPRS]_[673]_Capacity^2199^NBSC01 ^GPRS
[2G Flexi Additional 2 E1,T1  IF]_[909]_Capacity^151^NBSC01 ^2G_Flexi_Additional_2_E1,T1__IF
[2G Flexi Abis over IP/ Ethernet]_[1015]_Capacity^10^NBSC01 ^2G_Flexi_Abis_over_IP/_Ethernet
[1TRX Basic SW licence]_[1262]_Capacity^2800^NBSC01 ^1TRX_Basic_SW_licence
[Downlink Dual Carrier]_[1273]_Capacity^10^NBSC01 ^Downlink_Dual_Carrier
[105km Extended Cell for CS]_[1219]_Capacity^754^NBSC01 ^105km_Extended_Cell_for_CS
[Flexi Multiradio TRX HW Activation]_[1379]_Capacity^2600^NBSC01 ^Flexi_Multiradio_TRX_HW_Activation
[GSM Power License for MultiRadio]_[3730]_Capacity^130^NBSC01 ^GSM_Power_License_for_MultiRadio
[Extended CCCH]_[1826]_Capacity^700^NBSC01 ^Extended_CCCH
[Lb Interface basic]_[16]_Capacity^1^NBSC01 ^Lb_Interface_basic
[Lb AGPS]_[19]_Capacity^1^NBSC01 ^Lb_AGPS
[Lb UTDOA]_[20]_Capacity^1^NBSC01 ^Lb_UTDOA

If above doesn't meet your requirements then please do show us sample Input_file and expected output without editing it in future please.

Thanks,
R. Singh
This User Gave Thanks to RavinderSingh13 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

print next line if matches a particular word..need help

Hi i need a help for making a script whch can print next line if it matches a particular word like file1 have ename Mohan eid 2008 ename Shyam eid 345 if scipt got Mohan it will print next line (eid 2008) pls help me .......:) (2 Replies)
Discussion started by: anish19
2 Replies

2. Shell Programming and Scripting

Print line if first Field matches a pattern

Hi All, I would like my code to be able to print out the whole line if 1st field has a dot in the number. Sample input and expected output given below. My AWK code is below but it can;t work, can any expert help me ? Thanks in advance. {if ($1 ~ /*\.*/) { print $0 }} Input: ... (2 Replies)
Discussion started by: Raynon
2 Replies

3. Shell Programming and Scripting

How to print line if field matches?

Hi all, I got several lines line this a b c d e 1 e a 1 c d e 3 f a b c 1 e 8 h a b c d e 1 w a 1 c d e 2 w a b c d e 1 t a b c d e 7 4 How can I print the line if 1 is the field one before the last field? Basicly this 2 field ? a b c d e 1 e a b c d e 1 t The file I got is... (7 Replies)
Discussion started by: stinkefisch
7 Replies

4. UNIX for Advanced & Expert Users

Print line if subsrt matches array

Hi Folks! im printing all lines where the characters in position 270-271 match 33|H1|HA|KA|26 so i came up with this #!/bin/bash array=(33 H1 HA KA 26 ) for i in "${array}" do #echo $i awk '{ if (substr($0,270,2)~'/$i/') print; }' $1 >> $1.temp done It works fine . but... (2 Replies)
Discussion started by: phpsnook
2 Replies

5. Shell Programming and Scripting

Using regex's from file1, print line and line after matches in file2

Good day, I have a list of regular expressions in file1. For each match in file2, print the containing line and the line after. file1: file2: Output: I can match a regex and print the line and line after awk '{lines = $0} /Macrosiphum_rosae/ {print lines ; print lines } ' ... (1 Reply)
Discussion started by: pathunkathunk
1 Replies

6. Shell Programming and Scripting

awk to print the line that matches and the next if line is wrapped

I have a file and when I match the word "initiators" in the first column I need to be able to print the rest of the columns in that row. This is fine for the most part but on occasion the "initiators" line gets wrapped to the next line. Here is a sample of the file. caw-enabled ... (3 Replies)
Discussion started by: kieranfoley
3 Replies

7. Shell Programming and Scripting

Print entire line only if certain fixed character matches the string

Hi All, I have a file testarun.txt contains the below lines and i want to print the lines if the character positions 7-8 matches 01. 201401011111 201401022222 201402013333 201402024444 201403015555 201403026666 201404017777 201404028888 201405019999 201405020000 I am trying the... (4 Replies)
Discussion started by: Arunprasad
4 Replies

8. Shell Programming and Scripting

How to print line if two lines above it matches patterns.?

Hi, I could only find examples to print line before/after a match, but I'd need to print line after two separate lines matching. E.g.: From the below log entry, I would need to print out the 1234. This is from a huge log file, that has a lot of entries with "CLIENT" and "No" entries (+ other... (3 Replies)
Discussion started by: Juha
3 Replies

9. Linux

Print line 1 if line 3 matches of the output

Hi I want to extend following command so that on the basis of "Branch: ****" on the third line I can grep and print name of the file on the first line. cat .labellog.emd | grep DA2458A7962276A7E040E50A0DC06459 | cut -d " " -f2 | grep -v branch_name | xargs -I file <command to describe> file ... (1 Reply)
Discussion started by: ezee
1 Replies

10. Shell Programming and Scripting

Print line if values in fields matches number and text

datafile: 2017-03-24 10:26:22.098566|5|'No Route for Sndr:RETEK RMS 00040 /ZZ Appl:PF Func:PD Txn:832 Group Cntr:None ISA CntlNr:None Ver:003050 '|'2'|'PFI'|'-'|'EAI_ED_DeleteAll'|'EAI_ED'|NULL|NULL|NULL|139050594|ActivityLog| 2017-03-27 02:50:02.028706|5|'No Route for... (7 Replies)
Discussion started by: SkySmart
7 Replies
UFTDI(4)						   BSD Kernel Interfaces Manual 						  UFTDI(4)

NAME
uftdi -- USB support for serial adapters based on the FT8U100AX and FT8U232AM SYNOPSIS
uftdi* at uhub? ucom* at uftdi? DESCRIPTION
The uftdi driver provides support for various serial adapters based on the FTDI USB UART IC family. Supported chip models are FT8U100AX, FT8U232AM, FT232BM, FT232R, dual channel FT2232D, dual channel FT2232H, and quad channel FT4232H. The device is accessed through the ucom(4) driver which makes it behave like a tty(4). HARDWARE
The uftdi driver supports the following adapters: B&B Electronics uLinks RS-422/485 Coastal ChipWorks TNC-X Crystalfontz CFA-631 LCD Crystalfontz CFA-632 LCD Crystalfontz CFA-633 LCD Crystalfontz CFA-634 LCD Crystalfontz CFA-635 LCD CTI USB-485-Mini and and USB-Nano-485 Falcom Samba 55/56 GSM/GPRS modem Falcom Twist GSM/GPRS modem Future Technology Devices DB9 Future Technology Devices IC Future Technology Devices KW Future Technology Devices RS232 Future Technology Devices Y6 Future Technology Devices Y8 Future Technology Devices Y9 Future Technology Devices YS GlobalScale Technogogies SheevaPlug and OpenRD HP USB-Serial adapter shipped with some HP laptops Inland UAS111 Interpid Control Systems NeoVI Blue Interpid Control Systems ValueCAN Matrix Orbital LK/VK/PK202-24 LCD Matrix Orbital LK/VK204-24 LCD Matrix Orbital MX2/MX3/MX6 Series Matrix Orbital MX4/MX5 Series LCD QVS USC-1000 RATOC Systems REX-USB60F Robot Electronics USB to I2C Communications Module Sealevel Systems USB-Serial adapter SIIG US2308 Serial Telldus Tellstick and Tellstick Duo VScom USB-COM Mini SEE ALSO
tty(4), ucom(4), usb(4) HISTORY
The uftdi driver appeared in NetBSD 1.5. BSD
October 18, 2012 BSD
All times are GMT -4. The time now is 11:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy