![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Remove duplicates | forumthreads | Shell Programming and Scripting | 4 | 12-03-2008 10:51 AM |
| getting duplicates | megh | HP-UX | 4 | 09-14-2008 02:09 AM |
| lastlog has duplicates | chlawren | AIX | 1 | 06-19-2006 05:30 AM |
| Removing duplicates | giannicello | Shell Programming and Scripting | 12 | 09-14-2005 07:12 PM |
| Sendmail Duplicates | OBSESIK | UNIX for Dummies Questions & Answers | 0 | 02-28-2005 01:13 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
An interactive way to delete duplicates
1)I am trying to write a script that works interactively lists duplicated records on certain field/column and asks user to delete one or more. And finally it deletes all the records the used has asked for.
I have an idea to store those line numbers in an array, not sure how to do this in scripting. 2)Also how do I pipe pattern file into grep command Here is what i am trying to do cut -d" " -f2 | sort | uniq -d | grep -f ??? stuck here Do i have to write to temp file for it? |
|
||||
|
Sample data is like
Order# Appt No# Status 112 157 open 112 157 closed 113 123 open 113 234 open 113 123 closed The script should ask for every duplicate record what they want to do There are duplicated for 112 1) 112 157 open 2) 112 157 closed which one do you want to delete? There are duplicates for 113 1)113 123 open 2)113 234 open 3)113 123 closed which one do you want to delete? 2 After clean up data should look like If only deleted 113 which is wrong data Order# Appt No# Status 112 157 open 112 157 closed 113 123 open 113 123 closed |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|