commonline or removeing duplicate lines

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
neilbaker
Posts: 2
Joined: Thu Dec 03, 2009 7:28 pm

commonline or removeing duplicate lines

Post by neilbaker » Thu May 24, 2012 12:27 pm

Does anyone know how to remove duplicate lines from a file or var without useing the filter or replace commands. I've tried those and they take way to long About a hr and I have 5000 files to go thru. I'm still useing "studio" version. This script worked once
put commonLines (a,b) into c but after running it once it wouldnt work again and that code is in the documentation recipe for studio. If anyone can help this beginner will surely appreciate it.

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: commonline or removeing duplicate lines

Post by BvG » Thu May 24, 2012 12:34 pm

put it as keys into an array, then back again. There can always be only one key of the same text, so there'll be an automatic removal. Use a nonexistent char as secondary delimiter, to make sure nothing gets actually put into the contents of the array. for example:

Code: Select all

split theData by return and numtochar(0)
combine theData by return and numtochar(0)
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Post Reply