Re: how to compare 2 very large textfiles

2011-10-07 Thread Richard Gaskin
Alex Tweedly wrote: So I tried the sort + compare version. It is slightly slower than the array technique up to around 10,000 lines, pretty much the same up to 20,000 lines and then (sometimes) starts to edge ahead after that. I gave up trying at 40,000 lines :-) But if the data had been

Re: how to compare 2 very large textfiles

2011-10-06 Thread Michael Kann
: From: Matthias Rebbe matthias_livecode_150...@m-r-d.de Subject: how to compare 2 very large textfiles To: How to use LiveCode use-livecode@lists.runrev.com Date: Wednesday, October 5, 2011, 5:00 PM Hi, i need to compare two very large text files with about 5000 - 7000 lines each with a lines size

Re: how to compare 2 very large textfiles

2011-10-06 Thread Michael Kann
in the script that you used? Mike --- On Wed, 10/5/11, Matthias Rebbe matthias_livecode_150...@m-r-d.de wrote: From: Matthias Rebbe matthias_livecode_150...@m-r-d.de Subject: how to compare 2 very large textfiles To: How to use LiveCode use-livecode@lists.runrev.com Date: Wednesday, October 5

Re: how to compare 2 very large textfiles

2011-10-06 Thread Scott Rossi
figure it out. Mike --- On Wed, 10/5/11, Matthias Rebbe matthias_livecode_150...@m-r-d.de wrote: From: Matthias Rebbe matthias_livecode_150...@m-r-d.de Subject: how to compare 2 very large textfiles To: How to use LiveCode use-livecode@lists.runrev.com Date: Wednesday, October 5, 2011

Re: how to compare 2 very large textfiles

2011-10-06 Thread Matthias Rebbe
Hi Pete, thank you very much. It´s so much faster. It seems, i should look closer to arrays. Regards, Matthias Am 06.10.2011 um 01:13 schrieb Pete: I've used an array to do this type of operation in the past. Haven't tried this code but it might work better. repeat for each line i in

Re: how to compare 2 very large textfiles

2011-10-06 Thread Matthias Rebbe
, Matthias Rebbe matthias_livecode_150...@m-r-d.de wrote: From: Matthias Rebbe matthias_livecode_150...@m-r-d.de Subject: how to compare 2 very large textfiles To: How to use LiveCode use-livecode@lists.runrev.com Date: Wednesday, October 5, 2011, 5:00 PM Hi, i need to compare two very large

Re: how to compare 2 very large textfiles

2011-10-06 Thread Pete
Glad it worked Matthias. Could you give us an idea of the new timing using the arrays? Pete Molly's Revenge http://www.mollysrevenge.com On Thu, Oct 6, 2011 at 12:17 PM, Matthias Rebbe matthias_livecode_150...@m-r-d.de wrote: Hi Pete, thank you very much. It´s so much faster. It seems,

Re: how to compare 2 very large textfiles

2011-10-06 Thread Dick Kriesel
On Oct 5, 2011, at 3:00 PM, Matthias Rebbe wrote: Hi, i need to compare two very large text files with about 5000 - 7000 lines each with a lines size of up to 256 chars. I need to find out if there are lines missing in either file a or file b. What is the best way to do this with good

Re: how to compare 2 very large textfiles

2011-10-06 Thread Alex Tweedly
, 10/5/11, Matthias Rebbematthias_livecode_150...@m-r-d.de wrote: From: Matthias Rebbematthias_livecode_150...@m-r-d.de Subject: how to compare 2 very large textfiles To: How to use LiveCodeuse-livecode@lists.runrev.com Date: Wednesday, October 5, 2011, 5:00 PM Hi, i need to compare two very large

Re: how to compare 2 very large textfiles

2011-10-06 Thread Pete
-r-d.de wrote: From: Matthias Rebbematthias_livecode_**150...@m-r-d.dematthias_livecode_150...@m-r-d.de Subject: how to compare 2 very large textfiles To: How to use LiveCodeuse-livecode@lists.**runrev.comuse-livecode@lists.runrev.com Date: Wednesday, October 5, 2011, 5:00 PM Hi

Re: how to compare 2 very large textfiles

2011-10-06 Thread Matthias Rebbe
Hi all, let me explain what i am doing. I am working on a tool, which checks if two folders/harddrives are in sync. I create a detailed file list including all subfolders of each folder/drive. This 2 list are then compared. For my tests i created a stack with 2 Datagrids. I read in the

Re: how to compare 2 very large textfiles

2011-10-06 Thread Scott Rossi
wrote: From: Matthias Rebbematthias_livecode_**150...@m-r-d.dematthias_livecode_150...@m-r-d.de Subject: how to compare 2 very large textfiles To: How to use LiveCodeuse-livecode@lists.**runrev.comuse-livecode@lists.runrev.com Date: Wednesday, October 5, 2011, 5:00 PM Hi, i

Re: how to compare 2 very large textfiles

2011-10-06 Thread Bob Sneidar
It is possible, and indeed likely. When working with large text strings, every access to the string gets evaluated from the beginning to the end. You can see how this would be extremely time consuming. Arrays however are accessed using a kind of index so when you refer to an element such as

Re: how to compare 2 very large textfiles

2011-10-06 Thread Jim Ault
On Oct 6, 2011, at 5:50 PM, Matthias Rebbe wrote: put the dgtext of grp Festplatte 1 into tHDD1 put the dgtext of grp Festplatte 2 into tHDD2 REPEAT FOR each line i in tHDD1 put true into myArray[i][A] END REPEAT REPEAT FOR each line i in tHDD2 put true into myArray[i][B] END REPEAT

Re: how to compare 2 very large textfiles

2011-10-06 Thread Pete
matthias_livecode_150...@m-r-d.de wrote: From: Matthias Rebbematthias_livecode_**150...@m-r-d.de matthias_livecode_150...@m-r-d.de Subject: how to compare 2 very large textfiles To: How to use LiveCodeuse-livecode@lists.**runrev.com use-livecode@lists.runrev.com Date

Re: how to compare 2 very large textfiles

2011-10-06 Thread Pete
Good point Jim. As you say, it should work fine for fully qualified names. If the intent was to find duplicates as well as missing lines, then I would add 1 to myArray[i][A] instead of putting true in there. Then in the final repeat loop check for 1 in each key to list duplicates. Pete Molly's

Re: how to compare 2 very large textfiles

2011-10-06 Thread Alex Tweedly
On 06/10/2011 22:19, Pete wrote: Thanks for the report back on the speed Alex. I guess its academic if the speed is down to 100msecs but I'm wondering if a binary search technique would be better or worse (assuming the lists were sorted of course). How did you create the two lists for your

Re: how to compare 2 very large textfiles

2011-10-06 Thread Pete
Thanks Alex. I managed to cobble something together to get the test lists. I did try the binary search approach and it was way slower than the array approach as you predicted (Still much faster than the original code Matthias was using though). So I'm happy with the array technique now.

Re: how to compare 2 very large textfiles

2011-10-06 Thread Alex Tweedly
On 07/10/2011 00:45, Pete wrote: Thanks Alex. I managed to cobble something together to get the test lists. I did try the binary search approach and it was way slower than the array approach as you predicted (Still much faster than the original code Matthias was using though). So I'm happy

Re: how to compare 2 very large textfiles

2011-10-06 Thread Bob Sneidar
Not to beat a dead horse, but when converting a large string of text to an array, it might be somewhat faster to delete each line as you put it into the array, and only work with the first line. Very little scan times. Bob On Oct 6, 2011, at 4:45 PM, Pete wrote: Thanks Alex. I managed to

Re: how to compare 2 very large textfiles

2011-10-06 Thread Pete
Just when I thought I was safe! I see what you are doing to avoid LC locating lines itself, nice. The search I had in mind was different and used the binary search method and a recursive routine. Unfortunately I didn't save the code but it went roughy like this (the lists still have to be

Re: how to compare 2 very large textfiles

2011-10-06 Thread Pete
That's a good thought Bob, LC just has to look for the first line break that way. Pete Molly's Revenge http://www.mollysrevenge.com On Thu, Oct 6, 2011 at 4:59 PM, Bob Sneidar b...@twft.com wrote: Not to beat a dead horse, but when converting a large string of text to an array, it might be

how to compare 2 very large textfiles

2011-10-05 Thread Matthias Rebbe
Hi, i need to compare two very large text files with about 5000 - 7000 lines each with a lines size of up to 256 chars. I need to find out if there are lines missing in either file a or file b. What is the best way to do this with good speed? I tried to check each line in file a and if the

Re: how to compare 2 very large textfiles

2011-10-05 Thread Pete
I've used an array to do this type of operation in the past. Haven't tried this code but it might work better. repeat for each line i in tTextA put true into myArray[i][A] end repeat repeat for each line i in tTextB put true into myArray[i][B] end repeat repeat for each line k in the keys of

Re: how to compare 2 very large textfiles

2011-10-05 Thread dunbarx
, 2011 3:15 pm Subject: Re: how to compare 2 very large textfiles I've used an array to do this type of operation in the past. Haven't tried this code but it might work better. repeat for each line i in tTextA put true into myArray[i][A] end repeat repeat for each line i in tTextB put true

Re: how to compare 2 very large textfiles

2011-10-05 Thread Pete
does that HC could only draem of, at least as regards raw processing power, it is arrays. Craig newman -Original Message- From: Pete p...@mollysrevenge.com To: How to use LiveCode use-livecode@lists.runrev.com Sent: Wed, Oct 5, 2011 3:15 pm Subject: Re: how to compare 2 very