LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   help me (https://www.linuxquestions.org/questions/linux-newbie-8/help-me-4175512218/)

manjulakp29 07-25-2014 01:30 AM

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")

pan64 07-25-2014 01:40 AM

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

manjulakp29 07-25-2014 01:52 AM

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

pan64 07-25-2014 02:03 AM

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?)


All times are GMT -5. The time now is 08:44 PM.