LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Evaluate, Time Sync, and merge 2 arrays into 1

I have two separate text files I am reading in to be processed within
Labview. I read these two files in and convert them each into 2D
arrays. What I need to do is to evaluate these files and syncronize
times which are in the first column line by line. If they are
syncronized then I need to merge them into one array. Here is an
example of where I am at.

1st array
20-Feb-04 10:23:02 32.543 54.654
20-Feb-04 10:24:04 33.564 34.765

2nd array
20-Feb-04 10:23:57 45.543 24.654
20-Feb-04 10:24:56 71.564 22.765

How can I do this? I am sure there is some simple solution, I just
can't find it. The other thing that I need to do is this. Sometimes
the
times match in the same column, but are just off by the seconds.
Here is an example:

20-Feb-04 10:23:04 45.543 24.654
20-Feb-04 10:23:54 71.564 22.765

I need to throw out the second one. Basically I need to ignore the
seconds and just look at the hour and minute. I am trying to figure
out if I simply can evaluate each file, look for duplicates and delete
the second one, or compare them against each other. Any help would be
appreciated. Here are the files also to show you what I have thus
far.
Download All
0 Kudos
Message 1 of 2
(2,704 Views)
Hello,
I quickly created an .llb that contains the vi's you would need to perform these operations. From your description above, I took the two arrays that you have created, removed duplicates (hour/minute matching), and then appended the data from the second array to the corresponding data in the first array, based on the time stamp. I have included comments in these vi's to help you understand the algorithms I used. Also, in order to do the time stamp comparison, I just took the two times as strings, removed the seconds, and compared those values. I hope this helps. Let me know if you have any more questions! Good luck!

Jeremy L.
National Instruments
Jeremy L.
National Instruments
0 Kudos
Message 2 of 2
(2,704 Views)