Sponsored Content
Top Forums Shell Programming and Scripting Capture the value between brackets Post 302915595 by samsan on Thursday 4th of September 2014 01:52:33 AM
Old 09-04-2014
Capture the value between brackets

Hi
I am having hard time getting this right and need some help. I Have 3 files, and everyone contains the following:-

File1
Code:
Today, we have  Name(Jack)     Age(19)    Class (A2)
 Today, we have Name(Kim) Class (G9)

File2
Code:
Today, we have  Name(Lee)     Age(19)    Class (A2)
Today, we have Name(Nile)     Age (45)   Class (4R)
Today, we have Name(Kim) Class (G9)   Class (4R)

File3
Code:
Today, In Class (4T) we have  Name(Nick)     Age(19)   
Today, In Class (4Y) we have  Name(Sara)     Age(14) 
Today, In Class (4Y) we have  Name(Nile)     Age (45) 
Today, In Class (4Y) we have  Name(Jack)     Age(19)

I need to capture the value between brackets after Name only, but I don't want the name to be print twice.

So ,I am looking for output like this :-

Code:
Jack
Kim
Lee
Nile
Nick
Sara

Thank you

Last edited by Scrutinizer; 09-04-2014 at 03:23 AM.. Reason: code tags
 

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
DBIx::Class::Manual::DocMap(3pm)			User Contributed Perl Documentation			  DBIx::Class::Manual::DocMap(3pm)

NAME
DBIx::Class::Manual::DocMap - What documentation do we have? Manuals DBIx::Class::Manual - User's Manual overview. DBIx::Class::Manual::FAQ - Frequently Asked Questions, gathered from IRC and the mailing list. DBIx::Class::Manual::Intro - Introduction to setting up and using DBIx::Class. DBIx::Class::Manual::Example - Full example Schema. DBIx::Class::Manual::Cookbook - Various short recipes on how to do things. DBIx::Class::Manual::Troubleshooting - What to do if things go wrong (diagnostics of known error messages). DBIx::Class::Manual::Component - How to write your own DBIx::Class components. DBIx::Class::Manual::Glossary - What do all those terms mean? Setting up DBIx::Class::Schema - Overall schemas, and connection container. DBIx::Class::ResultSource - Source/Table definition functions. DBIx::Class::Relationship - Simple relationships. DBIx::Class::Relationship::Base - Relationship details. DBIx::Class::PK::Auto - Magically retrieve auto-incrementing fields. DBIx::Class::Core - Set of standard components to load. DBIx::Class::InflateColumn - Making objects out of your columns. DBIx::Class::InflateColumn::DateTime - Magically turn your datetime or timestamp columns into DateTime objects. DBIx::Class::PK - Dealing with primary keys. DBIx::Class::ResultSourceProxy::Table - Turns the resultsource into a table. DBIx::Class::AccessorGroup - Accessor grouping. Retrieving and creating data DBIx::Class::ResultSet - Selecting and manipulating sets. DBIx::Class::ResultSetColumn - Perform operations on entire columns of a ResultSet. DBIx::Class::Row - Dealing with actual data. DBIx::Class::Storage - Basic Storage stuff. DBIx::Class::Storage::DBI - Storage using DBI and SQL::Abstract. perl v5.14.2 2010-06-03 DBIx::Class::Manual::DocMap(3pm)
All times are GMT -4. The time now is 03:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy