![]() |
|
|
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 |
| remove an entry in crontab | melanie_pfefer | SUN Solaris | 1 | 12-18-2006 05:45 AM |
| Remove duplicate | sabercats | Shell Programming and Scripting | 2 | 03-31-2006 01:35 PM |
| Remove duplicate ??? | sabercats | Shell Programming and Scripting | 3 | 03-10-2006 07:06 PM |
| Hazardous Duplicate Cron Entry? | nag_sundaram | HP-UX | 3 | 07-14-2005 08:56 AM |
| Remove Duplicate line | Student37 | UNIX for Dummies Questions & Answers | 1 | 02-22-2005 03:00 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Remove duplicate entry in one line
Can anyone help me how can i print only the unique entry in a line?
MI_AP MI_AP MI_CM MI_MF RC_NAP MBS_AP SF_RAN MBS_AP NT_CAR so that it will on output the one unique entry per line. MI_AP MI_CM MI_MF RC_NAP MBS_AP SF_RAN NT_CAR I can't find the same situation on the knowledge base. |
|
|||||
|
It works now -- great! In any event, here is another solution in shell only: Code:
while read mLine do echo $mLine | tr ' ' '\n' > Temp cat -n Temp | tr '\t' '|' | sort -t'|' -k2 | uniq +7 | sort | sed 's/.*|//' | paste -d' ' -s - done < input_file |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|