Sponsored Content
Top Forums Shell Programming and Scripting Capture the value between brackets Post 302915605 by Scrutinizer on Thursday 4th of September 2014 02:23:50 AM
Old 09-04-2014
Another one:
Code:
awk -F '.*Name[(]|[)]' '!A[$2]++{print $2}' file*

On Solaris use /usr/xpg4/bin/awk rather than awk


---
@Srinishoo there should be no space in the the Field Separator otherwise it will not find names with spaces in them...
Code:
awk -F '[)(]' '{for(i=1; i<=NF; i++) {if($i~/Name$/) ....


Last edited by Scrutinizer; 09-04-2014 at 03:35 AM..
 

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Angle brackets

From the Apache thread in the Adanced forum: Thats because your browser interprets anything within angle brackets to be an HTML tag. You need to quote these brackets if you want them to appear correctly. The proper quotes are: &amp;lt; for < and &amp;gt; for > So, for example, you would have... (1 Reply)
Discussion started by: PxT
1 Replies

2. UNIX for Dummies Questions & Answers

square brackets

I would like to substitute a phrase which contains square brackets. change TO how? Thanks (2 Replies)
Discussion started by: gilead29
2 Replies

3. Shell Programming and Scripting

how do you use brackets ?? in a script.

:D i am pretty much new to scripting and don't want to pick up bad habits so I am trying to get myself to use brackets in my scripts since I plan on using them alot.. ! in this example of a script I wrote I can not figure out where the brackets go can anyone give me some insight into the use of... (3 Replies)
Discussion started by: moxxx68
3 Replies

4. UNIX for Dummies Questions & Answers

usage of brackets for if

Hi, I would like to know about the usage of brackets to negate a set of boolean evaluations an equivalent to what i am trying is below if or || ] ] then echo"valid time of day" else echo "invalid input" exit fi the bracket structue as mentioned doesnt work .. i am using ksh.... (4 Replies)
Discussion started by: lakshmikanth
4 Replies

5. Shell Programming and Scripting

help to delete brackets [ ]

hi all, i want to delete brackets in all the file and to keep the string or data between them ( example Q --> Qxxx) with sed command.. thanks (4 Replies)
Discussion started by: kamel.seg
4 Replies

6. Shell Programming and Scripting

Get value between brackets

Hi I am having hard time getting this right and need some help. I Have several log files, and everyone contains the following 3 lines at the end: 4 ETW000 Disconnected from database. 4 ETW000 End of Transport (0000). 4 ETW000 date&time: 13.01.2011 - 08:03:28 I need to capture the value... (7 Replies)
Discussion started by: nimo
7 Replies

7. Shell Programming and Scripting

How to get the value in the first brackets

Hello, I am trying to write a script using ksh. And I want to get the value within the first brackets of a string. For example: 14/04/11 11:35: 00 This is (nn) from the earth. Then i hope to get nn in this case. Can any one advise me how to implement it? Thank you very much! nn (2 Replies)
Discussion started by: n_n
2 Replies

8. Shell Programming and Scripting

Delete text between square brackets and also delete those square brackets using sed or awk

Hi All, I have a text file which looks like this: computer programming systems engineering I want to get rid of these square brackets and also the text that is inside these brackets. So that my final text file looks like this: computer programming systems engineering I am using... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies

9. Shell Programming and Scripting

adding brackets

Hi, If you suppose that you have two columns of numbers, and I want to merge these two columns into one and put a bracket around it. and perphaps add a dash between two numbers. input.txt 1 2 3 4 5 6 7 8 output.txt (1-2) (3-4) (5-6) (7-8) Thanks in advance! Please use... (2 Replies)
Discussion started by: johnkim0806
2 Replies

10. Shell Programming and Scripting

Brackets

Hi all. i need a small help. i have written an exit code, which will check whether mo.sh is successful or not. if the status is >0 it will exit the shell. 1>Do you guys think it is a correct way to write? 2>what if i change the double bracket to single. how will it change the o/p. ... (1 Reply)
Discussion started by: sub
1 Replies
V4l(3pm)						User Contributed Perl Documentation						  V4l(3pm)

NAME
Video::Capture::V4l - Perl interface to the Video4linux framegrabber interface. SYNOPSIS
use Video::Capture::V4l; DESCRIPTION
Not documentation AGAIN! Please see the scripts grab, inexer or vbi that are packaged in the distribution and direct any question and feature requests (as well as bug reports) to the author. Exported constants The following hideous constants are defined in the "Video::Capture::V4l" package, but you rarely need to use them. AUDIO_BASS AUDIO_MUTABLE AUDIO_MUTE AUDIO_TREBLE AUDIO_VOLUME CAPTURE_EVEN CAPTURE_ODD MAX_FRAME MODE_AUTO MODE_NTSC MODE_PAL MODE_SECAM PALETTE_COMPONENT PALETTE_GREY PALETTE_HI240 PALETTE_PLANAR PALETTE_RAW PALETTE_RGB24 PALETTE_RGB32 PALETTE_RGB555 PALETTE_RGB565 PALETTE_UYVY PALETTE_YUV410P PALETTE_YUV411 PALETTE_YUV411P PALETTE_YUV420 PALETTE_YUV420P PALETTE_YUV422 PALETTE_YUV422P PALETTE_YUYV SOUND_LANG1 SOUND_LANG2 SOUND_MONO SOUND_STEREO TUNER_LOW TUNER_MBS_ON TUNER_NORM TUNER_NTSC TUNER_PAL TUNER_RDS_ON TUNER_SECAM TUNER_STEREO_ON TYPE_CAMERA TYPE_TV VC_AUDIO VC_TUNER TYPE_CAPTURE TYPE_CHROMAKEY TYPE_CLIPPING TYPE_FRAMERAM TYPE_MONOCHROME TYPE_OVERLAY TYPE_SCALES TYPE_SUBCAPTURE TYPE_TELETEXT TYPE_TUNER AUTHOR
Marc Lehmann <schmorp@schmorp.de> LICENSE
This module is available under GPL only (see the file COPYING for details), if you want an exception please contact the author, who might grant exceptions freely ;) SEE ALSO
perl(1). perl v5.14.2 2011-11-15 V4l(3pm)
All times are GMT -4. The time now is 11:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy