954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to detect duplicate fileds in a file

Hello,
I have a file with each line consisting of certain fields. Lets say I want to detect which lines have the second field equal..

For example here is the file:

XM2 N$2 N$2 GROUND GROUND nch_mac1 l=50n w=150n multi=1 nf=1 sd=140n
XM1 N$12 N$2 GROUND GROUND nch_mac2 l=50n w=150n multi=1 nf=1 sd=140n
XM3 N$2 N$2 GROUND GROUND nch_mac3 l=50n w=150n multi=1 nf=1 sd=140n
XM4 N$13 N$2 GROUND GROUND nch_mac4 l=50n w=150n multi=1 nf=1 sd=140n
XM5 N$2 N$2 GROUND GROUND nch_mac5 l=50n w=150n multi=1 nf=1 sd=140n
XM6 N$15 N$2 GROUND GROUND nch_mac6 l=50n w=150n multi=1 nf=1 sd=140n
XM7 N$3 N$2 GROUND GROUND nch_mac7 l=50n w=150n multi=1 nf=1 sd=140n
XM8 N$3 N$2 GROUND GROUND nch_mac8 l=50n w=150n multi=1 nf=1 sd=140n


And I want to print which lines have the same second field.

bojomojo
Newbie Poster
24 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You