Author |
Message
|
Charlesn1 |
Posted: Tue Oct 05, 2010 3:05 am Post subject: Remove 2nd duplicate field not whole line on a message tree |
|
|
Newbie
Joined: 21 Sep 2010 Posts: 6
|
* please do not use *
Last edited by Charlesn1 on Thu Oct 14, 2010 7:04 am; edited 1 time in total |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 05, 2010 3:11 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
kimbert |
Posted: Tue Oct 05, 2010 3:13 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Thanks for sharing that code snippet. |
|
Back to top |
|
 |
Charlesn1 |
Posted: Thu Oct 14, 2010 12:55 am Post subject: code tags |
|
|
Newbie
Joined: 21 Sep 2010 Posts: 6
|
could you please show me an example |
|
Back to top |
|
 |
kimbert |
Posted: Thu Oct 14, 2010 1:15 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Example of what? Please state your problem clearly, accurately and fully. |
|
Back to top |
|
 |
Charlesn1 |
Posted: Thu Oct 14, 2010 2:04 am Post subject: comparing lines till i find duplicates |
|
|
Newbie
Joined: 21 Sep 2010 Posts: 6
|
i needed to compare all lines till i find duplicates
for eg 1 to 1 , 1 to 2 , 1 to 3
2 to 3 , 2 to 4
3 to 4 , 3 to 5
etc |
|
Back to top |
|
 |
kimbert |
Posted: Thu Oct 14, 2010 2:50 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Please describe your data, and then tell us exactly what 'duplicate' means.
This forum is provided for free, but it is not a consultancy service. We expect you to take some of *your* time to explain *your* problem clearly. Otherwise you end up wasting *our* time, which makes it less likely that we will want to help you.
No more help until you play by the rules. |
|
Back to top |
|
 |
Charlesn1 |
Posted: Thu Oct 14, 2010 3:01 am Post subject: |
|
|
Newbie
Joined: 21 Sep 2010 Posts: 6
|
i have this file as input, i need to compare each line to the next till i find duplicates see the bold text ,
11/10/10 - 18:59:19:15|ZMO00842|Title: 19:30 The Suite Life On Deck(Last) The Amazing Race, O|00:08:00:00|00:08:30:00|00:00:30:00|
11/10/10 - 18:59:50:00|CE55258A|STA/010/001/E/T|00:28:52:13|00:29:02:13|00:00:10:00|abcd|2341861|
11/10/10 - 18:59:51:00|DVE Key|DVE Key|00:00:00:00|00:00:08:00|00:00:08:00|
11/10/10 - 21:59:29:15|ZMO00942|Tom: 19:30 The Big Bang Theory, 20:00 Solving It, 20:31 Special|00:09:00:00|00:09:20:00|00:00:20:00|
11/10/10 - 21:59:50:00|CE55258A|STA/010/001/E/T|00:28:52:13|00:29:02:13|00:00:10:00|abcd|2341861|
expected
11/10/10 - 18:59:19:15|ZMO00842|Title: 19:30 The Suite Life On Deck(Last) The Amazing Race, O|00:08:00:00|00:08:30:00|00:00:30:00|
11/10/10 - 18:59:50:00|CE55258A|STA/010/001/E/T|00:28:52:13|00:29:02:13|00:00:10:00|abcd|2341861|
11/10/10 - 18:59:51:00|DVE Key|DVE Key|00:00:00:00|00:00:08:00|00:00:08:00|
11/10/10 - 21:59:29:15|ZMO00942|Tom: 19:30 The Big Bang Theory, 20:00 Solving It, 20:31 Special|00:09:00:00|00:09:20:00|00:00:20:00|
[b]11/10/10 - 21:59:50:00|CE55258A|STA/010/001/E/T|00:28:52:13|00:29:02:13|00:00:10:00| |
|
Back to top |
|
 |
Charlesn1 |
Posted: Thu Oct 14, 2010 3:24 am Post subject: data |
|
|
Newbie
Joined: 21 Sep 2010 Posts: 6
|
11/10/10 - 21:59:50:00|CE55258A|STA/010/001/E/T|00:28:52:13|00:29:02:13|00:00:10:00|abcd|2341861|
|Date and Time|clipid|cliptitle|duration|userdata| |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Oct 14, 2010 3:55 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
So which piece is the unique key?
You could create a ROW variable that held a child for each unique key, and if you found that such a child existed for the current row, you could then delete the current row.
You could potentially even have that ROW variable hold a reference to the full row. |
|
Back to top |
|
 |
Charlesn1 |
Posted: Thu Oct 14, 2010 4:06 am Post subject: userData is the main unique field |
|
|
Newbie
Joined: 21 Sep 2010 Posts: 6
|
* please do not use *
Last edited by Charlesn1 on Thu Oct 14, 2010 6:06 am; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Thu Oct 14, 2010 4:44 am Post subject: Re: userData is the main unique field |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Charlesn1 wrote: |
here is the code i tried, please check
|
Not until you start reading what people are posting!
Specifically:
- using [c o d e] tags when posting code
- answering questions asked with relevent information (like describing the key fields) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Thu Oct 14, 2010 5:19 am Post subject: Re: userData is the main unique field |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
Charlesn1 wrote: |
here is the code i tried, please check |
When you ask us to check it? Are you asking us to try it in our own environments and see what happens? Maybe then update the code and send it back to you?
What happened when you "checked" it?
My comments:
1) it looks like it wont achieve your goal in its current form.
2) it looks like the final solution may end up being a quadratic.
Hope that helps |
|
Back to top |
|
 |
|