![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| using a vaiable parameters and values to find and tar | jjminkle | Shell Programming and Scripting | 1 | 05-02-2008 05:12 PM |
| Copy unique files between two directories in Solaris | sujoy101 | Shell Programming and Scripting | 2 | 03-22-2008 02:59 AM |
| grepping many values from same files | Sreejith_VK | Shell Programming and Scripting | 2 | 03-15-2008 08:41 AM |
| to retrieve unique values | mahalakshmi | Shell Programming and Scripting | 3 | 02-05-2007 09:30 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Need to find only unique values for a given tag across the files
Need to find only unique values for a given tag across the files:
For eg: Test1: <Tag1>aaa</Tag1> <Tag2>bbb</Tag2> <Tag3>ccc</Tag3> Test2: <Tag1>aaa</Tag1> <Tag2>ddd</Tag2> <Tag3>eee</Tag3> Test3: <Tag1>aaa</Tag1> <Tag2>ddd</Tag2> <Tag3>eee</Tag3> Test4: <Tag1>bbb</Tag1> <Tag2>ddd</Tag2> <Tag3>eee</Tag3> grep "<Tag1>" test* --> This command will return the following test1:<Tag1>aaa</Tag1> test2:<Tag1>aaa</Tag1> test3:<Tag1>aaa</Tag1> But I need the following results: test1:<Tag1>aaa</Tag1> test4:<Tag1>bbb</Tag1> ==> I don't want "test2" and "test3" to appear since they are same as "test1" results |
|
||||
|
Thank you very much. Both of them work!
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|