comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: compare ascii files, EOF
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: compare ascii files, EOF [message #31644] Mon, 29 July 2002 08:22 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
c7kowo@geogr.uni-jena.de (Wolfgang Koppe) writes:

> Hi,
> I�trying to compare 2 ascii-files with the "where"-fuction to get to
> know which rows are equal. Both files have different lengths. The
> query starts at row 1 and stops at the end of the shorter file. But I
> would like to query till the end of the longer file.
> I�ve tried it with the EOF-fuction, but it doesn�t work.

As Reimar has pointed out, you can use a set-comparison function, like
his, or like my CMSET_OP. However this can be dangerous in the
presence floating point numbers since you will hit precision issues.

I would have said that if your files are in time order, and small
enough, then using a FOR or WHILE loop may be appropriate.
Unfortunately your file2 has values out of time order.

Another possibility is to combine the two files into one array, SORT()
them, and look for pairs of values that are close. You will also have
to maintain a secondary array describing the source of the value (1 or
2). Internally this is what CMSET_OP does.

Good luck,
Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: bizarre number transformation
Next Topic: Trip to Ol' Stomping Grounds

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Dec 05 00:25:24 PST 2025

Total time taken to generate the page: 0.00227 seconds