LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Need lines with most inforamtions in them (https://www.linuxquestions.org/questions/programming-9/need-lines-with-most-inforamtions-in-them-4175529122/)

nameprabhat 12-23-2014 02:53 PM

Need lines with most inforamtions in them
 
my file is below:

1)prabhat,,"admin","","","",,,,,"",,
2)prabhat,,"admin","user","window","linux",,,,,"",,
3)shayam,,"admin","","","",,,,,"",,
4)raja,,"admin","user","window","linux",,,,,"",,
5)badam,,"admin","","","",,,,,"",,
6)devam,,"admin","user","window","linux",,,,,"",,

now i need only those rows from this files where name is associated with more roles.
ex: in 1st and 2nd rows name prabhat is same and roles are different. in o/p row 2 should come not row 1.
"" under them their are roles, 1st row contains the name.

If there is only 1 row with name then that should come under outout as well.

Code in perl/shell/awk anything would be helpful!! Thanks.

schneidz 12-23-2014 03:12 PM

what have you tried and where are you stuck ?

dugan 12-23-2014 03:30 PM

Are the numbers and brackets that begin each line part of the file?

nameprabhat 12-23-2014 03:55 PM

1)...these are not part of original file i have out here to mention lines separetely.

this was the part of bigger program ..where i come down to this after sorting and finding unique records from different files. now i am able to find any logic to separate these rows.

grail 12-24-2014 02:25 AM

As first post has indicated ... where is your attempt and where are you stuck?


All times are GMT -5. The time now is 09:42 PM.