LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-25-2014, 01:30 AM   #1
manjulakp29
LQ Newbie
 
Registered: Jul 2014
Posts: 2

Rep: Reputation: Disabled
help me


I have many folder in which i have .feature files .I need find the duplicate testcaseid ,along with file name and line number .
I have written part of the code .

find . -name '*.feature' -exec egrep -n --with-filename --only-matching '@TestCaseId\("[^"]*"\)' {} '+' |sort

the output of this is like this -

./stock.app.feature:34:TestCaseId("FUN.NAVI.DRIVING.003")
./stock.app.feature:56:TestCaseId("FUN.NAVI.DRIVING.003")
./stock.app.feature:86:TestCaseId("FUN.NAVI.DRIVING.005")
./stock.app.feature:100:TestCaseId("FUN.NAVI.DRIVING.005")
./stock.app.feature:201:TestCaseId("FUN.NAVI.DRIVING.007")
./stock.app.feature:207:TestCaseId("FUN.NAVI.DRIVING.008")
 
Old 07-25-2014, 01:40 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
what kind of help do you need?
You want to find duplicate testcases, so just look around on the net, you will find a lot of solutions: http://www.theunixschool.com/2012/10...s-of-file.html
 
Old 07-25-2014, 01:52 AM   #3
manjulakp29
LQ Newbie
 
Registered: Jul 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi,

The output contain the file name ,line number ,test case id .
From this i want to print the duplicate values ,line number and test case id .
I tried using uniq -d it gives unique values as it see the line number as unique
So how do i proceed
 
Old 07-25-2014, 02:03 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
for example see man uniq, especially the flag -f, but first you need to replace : to space (use sed or tr). (what about the link I gave you?)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration