The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-06-2009
chvs2000 chvs2000 is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 5
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?
  #2 (permalink)  
Old 02-06-2009
Shahul's Avatar
Shahul Shahul is offline
Registered User
  
 

Join Date: Aug 2008
Location: India
Posts: 175
Talking

Hi there,

Give us some sample input & output data details.....
so that we will try something...
  #3 (permalink)  
Old 02-06-2009
chvs2000 chvs2000 is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 5
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
  #4 (permalink)  
Old 02-07-2009
paolopogi23 paolopogi23 is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 5
Hey!! sounds like a homework to me .
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:34 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0