Searching 1D array for data present in lookup 1D array.

Hi!,
I have a sorted 1D array of strings(say initial array) and I have
three lookup array of string(say array A, array B and array C). I want
to search the initial array with array A, array B and array C and then
create a new array Final which will contain the elements of array A,
if any, its start index and its last index and then element sof
arrayB, if any found, its start index and its end index and then
element of array C its start index and its end index.
The start index and end index are stored in different indicatrs for
all the three found.
How do I search elements of 1D array with another 1D array?
TIA,
RK

There are probably several ways to do it. One way to do it you would create a For Loop with the initial array run into it with auto-indexing turned off. You would then run array A into it with auto-indexing turned on. Inside of the loop, you would use a Search Array to find the index (if any) of the element in the initial array that matched the auto-indexed element of Array A. You will want to either build an array of only the indexes >=0 (trapping the "not found" -1) or you can autoindex the results and have you later code deal with them.
You will need three of these loops, one for each searching array. Or better, you could push it into a subVI and call it three times.
I hope that this helps!
Bob Young
Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
DISTek Integration, Inc. - NI Alliance Member
mailto:[email protected]

Similar Messages

  • 1D Array for Data to buffer

    I have a force plate that sends out forces in the x,y,z and i need to be able to index them into a 1D array for a buffer.  I think i have the ground work of the program laid out but im not sure where to go from here.  See attached program.  Thanks for any possible help.  
    Attachments:
    Buffer.vi ‏20 KB

    Your VI will run forever because you have a False constant wired to the stop terminal of the loop.
    Why do you have a while loop in there anyway?
    You don't have any element going into your replace array subset.  So you have a broken arrow.
    I don't understand the meaning of your buffer full boolean.  It really isn't telling whether your buffer is full or not.  It doesn't even track how many times you've replaced various elements in the array.  It just checks whether the value you used for index is a multiple of your buffer size.  Let's say yor buffer size is 10.  If you use an index 9, the remainder of 9 mod 10 is 9, it's not equal to 0, so the boolean is false.  Okay.
    Now if your index is 10, 10 mod 10 is 0, it's equal to 0, so the boolean is true.  Okay.
    Now if your index is 11 (obviously bigger than 10)  11 mod 10 is 1.  It's not equal to 0, so the boolean is back to false.   But is seems like you really intend for it to be true.
    You aren't really ever checking if your array is "full".  You are just comparing your entered index to your "buffer size" input, which may not actually have anything to do with the size of the array.

  • Most efficient way to pack U16 -- U32 Array for Data DMA Transfer?

    I have an RT controller that wants to send down data to an FPGA using DMA.  In LabVIEW 8.2, I have no choice but to pass down U32 blocks of data however my my input data is a U16 array.  This leaves me two choices:  1) Wire the U16 Array directly to the DMA node which will coarse it to U32 but I'm wasting 16bit*#of elements 2) Pack the U16 array into a U32 Array prior to sending it down.    I would like to do #2 and I have a method that works (and seems to be pretty efficient) but I have a feeling I am doing it the hard way (or roundabout way).   Is  their a simpler (but just as efficient) way to do this procedure?  Thanks
    Solved!
    Go to Solution.
    Attachments:
    ni1.gif ‏8 KB
    ni2.gif ‏10 KB

    SiegeX wrote:
    ... unfortunately I forgot to mention that byte order does matter and odd # of inputs are allowed.
    See, that something that does not make full sense here, because you end up with a mixed byte order, because the 16bit halves are still big endian. What's at the "other" end, exactly?
    Anyway, here's a slight simplification of the previous code. (The typecast is better if we can do it all big endian and omit the "decomate/interleave" dance.)
    (You could also flatten to a string and back. This has the advantage that byte order is a direct option. I don't know how that is, performance wise.))
    Message Edited by altenbach on 11-12-2008 04:31 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    typecasting3.PNG ‏4 KB

  • Select Multiple into array for data insertion

    I have a form that contains a menu/list that allows multiple selections. The list is bound to a dynamic source with label = to a name and value = to the names record ID. The code DW CS4 generates is:
    <select name="vVol_id" size="20" multiple="MULTIPLE" id="vVol_id">
    <?php
    do { ?>
                    <option value="<?php echo $row_rsGetStaff['vol_id']?>"><?php echo $row_rsGetStaff['full_name']?></option>
                    <?php
    } while ($row_rsGetStaff = mysql_fetch_assoc($rsGetStaff));
      $rows = mysql_num_rows($rsGetStaff);
      if($rows > 0) {
          mysql_data_seek($rsGetStaff, 0);
          $row_rsGetStaff = mysql_fetch_assoc($rsGetStaff);
    ?>
    </select>
    What additional code do I need to get the selected items into an array that can be 'foreach'd' to insert the selections into another table when the submit button is clicked? This one has been driving me nuts.

    You just need the square brackets, something like: <select name="vVol_id[]"
    vVol_id will then be an array if items are selected.
    Ed

  • Search help for DATE field

    HI all,
    I want to attach search help for a DATE field created in screen painter.
    For PERNR, PREM is attached. Similarly what is the statndard search help name for DATE field?
    Thanks,
    Shanthi.

    Hi ,
    Declare the date field as sy-datum ,
    parameters : date type sy-datum .
    This shud bring the standard search help for date .
    Thanks ..Get back for any issues.
    Anil

  • How to search a .csv file for data using its timestamp, then import to labview

    Hi, I'm currently obtaining density, viscosity and temperature data from an instrument, adding a timestamp and writing it to a .csv file which I can view in Excel. This works fine (see attached code) but what I need to do now is to search that csv file for data which was obtained at a certain time, import the temperature, density & viscosity values at this time back into Labview to do some calculations with them, while the data acquisition process is still ongoing.
    I've found various examples on how to import an entire csv file into labview, but none on how to extract data at a specific time. Also, whenever I try to do anything with the .csv file while my data acquistion VI is running, I receive error messages (presumably because I'm trying to write to and import data from the .csv file simultaneously). Is there some way around this, maybe using case structures?
    If you need to know my skill level, I've been using Labview for a few weeks and prior to that have basically no experience of writing code, so any help would be great. Thanks!
    Solved!
    Go to Solution.
    Attachments:
    Lemis VDC-30 read registers MODBUS v5.vi ‏56 KB

    It sounds as if you are going about this a little backwards writing to a data file and then extracting from the file but its the weekend so I can't think of an improved way to do it at the moment. 
    Searching for a specific time with those specific values is quite easy, or if you wanted to select any time then you could interpolate the values to find any value that you want (This is where the contiguous measurement comes in, as you have readings at discrete times you will have to interpolate the values if you want to get the 'measured value' at a time point that is not exactly one of your measured points).
    If you can extract the TDMS time column and the T, D & V then simply thresholding and interpolating each of your array/data sets should allow readings at your desired times.
    Attachments:
    Interpolate.png ‏301 KB

  • Searching for a Range Within a 1D Array

    First, I should say that I did a search through the forums and tried some of the results but couldn't get the results that I was looking for.
    I have a 1D array of a column of temperature data.  The temperature data spans roughly 10 degrees total, and most of it is accurate to the thousandths digit place (X.xxx). 
    What I need to do with this data is separate it into certain ranges or manipulate it in its current state.
    Less than range A has something happen to it, between A and B has something happen to it, C and D... etc.  The easiest way to do this would probably just separate them into their own arrays and go from there, but im kind of at a loss at how to do this.  I tried to make a CASE structure work but i failed.  Any help would be great!

    takari wrote:
    Less than range A has something happen to it, between A and B has something happen to it, C and D... etc.  The easiest way to do this would probably just separate them into their own arrays and go from there, but im kind of at a loss at how to do this.  I tried to make a CASE structure work but i failed.  Any help would be great!
    What is "something" that needs to be done??? For example if you simply want to average the subranges, there is no need to built the arrays up first).
    To split the data into seperate arrays depending on defined ranges, you could do something as in the attached.
    (Of course you lose all information about original order of the elements. If order does not matter, you could simply sort the array then split it at the thresholds, for example)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SplitByRange.vi ‏15 KB

  • Can i have html code for date select options (SEARCH HELP)

    Hi frinds,
    I have a BSP Page with input as date.
    Can i have html code for date select options (SEARCH HELP)
    Moosa

    Hi
    Please find the sample code below.
    FROM DATE
          <htmlb:inputField id        = "dd"
                            width     = "45%"
                            type      = "DATE"
                            showHelp  = "X" <- Search help
                            alignment = "CENTER"
                            maxlength = "10"
                            disabled  = "TRUE"
                            value     = "<%= w_FROMDATE %>" />
    TO DATE
          <htmlb:inputField id        = "dd"
                            width     = "45%"
                            type      = "DATE"
                            showHelp  = "X"
                            alignment = "CENTER"
                            maxlength = "10"
                            disabled  = "TRUE"                      
    value     = "<%= w_TODATE %>" />
    Thanks
    kalyan

  • Whenever I go to iTunes with my iPod 5th generation 32 gb iPod Touch, running iOS 8.0.2, It tells me that the "Other" category is using up 14.59 gb of data. I have no clue why it says this and I have searched the internet for fixes and none worked.

    Whenever I go to iTunes with my iPod 5th generation 32 gb iPod Touch, running iOS 8.0.2, It tells me that the "Other" category is using up 14.59 gb of data. I have no clue why it says this and I have searched the internet for fixes and none worked. I have tried on a windows and a mac and noticed no change. I have tried restoring to a backup but that didn't help. I haven't had time to do a full restore but I will try if the problem persists.

    An "other" larger than about 1 1/2 GB indicates corrupted files.
    What is the Other on my iPhone and How to Remove It
    What is "Other" and What Can I Do About It?
    Next, usually restoring from backup eliminated the corrupted files. However, sometimes restoring to factory settings/new iPod is required.
    To restore from backup see:
    iOS: How to back up
    To restore to factory settings/new iPod see:
    iTunes: Restoring iOS software

  • Search help for date in VC

    Hi, 
    I have created an iview in Visual Composer for a query. it contains date field on selection variable fomr. i tried entering date in various format, but it gives an error : variable expects interval value ; enter an interval".
    can we provide search help for date field in VC?
    Regards,
    Sonali.

    Hi,
    You have to create search help it avoid inconsistency.
    Thanks & Regards,
    Venkat.

  • Searching for data

    I have a program that reads from a notepad file into an array, the user is then to enter a number into a message box and the program is supposed to find all entries like that find the average number and then show the highest number as well. how do i go about doing this???? i am new to java so dont get too technical with the answers please cos i wont understand it. Thanks

    You can read the file line by line using the FileReader class and then search each line for the numbers. Then add these numbers to an ArrayList and use the Collections.max() method to get the highest number. First, try this and we can get back to determining the average later.
    If you don't know about I/O and Collections, you should read the tutorial:
    http://java.sun.com/docs/books/tutorial/essential/io/index.html
    http://java.sun.com/docs/books/tutorial/collections/index.html

  • To implement search help for date and time fields details

    how can i implement search help for date and time fields in screen painter

    Hi
    Declare the variables as sy-datum and sy-uzeit or any other pre-defined data typ of date and ime types. Serach help will automatically comes.
    Aditya

  • When can we expect a patch for Object Array List Data Provider?

    Hey JSC Team!
    When can we expect maybe, just maybe a minor patch for the Object Array List Data Provider loading class problem? Next Month? This Year? Next Year? Near Future? Long in the future? Sometime in the 22nd century?

    I think one of the problem is
    when u declare the ObjectListDataProvider in ur backing bean
    it doesnt appear in the design time straight away
    u have to clean build close and re open the project
    which is quite time consuming.

  • Advanced Keyword Searches (for data on ftp)

    Does anyone happen to know if running an Advanced Google Search will turn up data in the Public folder on my website that is not otherwise linked to my website? I have a couple of websites and I am trying to make sure I understand what is publicly available, what can be "scoured" and downloaded and how careful I really have to be with this.
    I also have a Wordpress Blog that allows for a PASSWORD PROTECTED post but I was not able to find out from their help forum if the Images that were uploaded as part of this post, or the pdf's that were linked to in this post - are in fact available via an Advanced Google Search. Since I upload the pdf's and the images to a Public folder on the site I assume this is the case.
    If so, I'd love to make sure I know how easy it would be for someone to download /all/ of this information.
    THANKS for any tips on this topic.

    888442 wrote:
    Hi,
    We have an existing setup of physical standby database on 11.1.0.7 on Linux (primary 2 node rac)
    Now, the customer has bought licence for Advance compression and we want leverage this in our standby setup.
    The existing parameter what we have is
    log_archive_dest_2 =SERVICE=STDBY_SWPRDENT ARCH ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=STDBY01 NET_TIMEOUT=60
    what changes do i need to change this for advance compression option.Some more reference, Check this manual
    http://docs.oracle.com/cd/B28359_01/server.111/b28294/log_arch_dest_param.htm#BABBFBDI
    http://docs.oracle.com/cd/B28359_01/server.111/b28294/log_transport.htm

  • 8.0.2 - problem 1 - unable to scroll screen when the keyboard is present. Huge problem for emails and other cloud based providers that allow for data entry. We need a fix ASAP!

    8.0.2 - problem 1 - unable to scroll screen down or up when the keyboard is present. When typing text, I am unable to see the text I am writing due to this problem. Huge problem for emails and other cloud based providers that allow for data text entry. While the keyboard is present, I am unable to scroll down to see the text, the screen automatically scrolls back up to the top of the screen. We need a fix ASAP!

    Have you tried resetting your iPad? You will not lose any data. Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

Maybe you are looking for

  • Can not update my system and not able to repair disk

    I havn't used my macbook pro for about a year, and recently I need to travel to another place and need it with me. I see in AppStore that there is an update for my ios, I downloaded it, and run the install. however, when updating my system. I run int

  • How to get rid of character (A, B or C) in a field after space.

    HI All I have a field of length 18 i.e char 18 (MATNR) It can have values as below      u2018AE10036   Bu2019                                                      u2018AE10091  A u2019                                                      u2018AE10116

  • Default Dataexport options in Hyperion 9.3.3 vs 11.1.2.1

    We're doing a data comparison between 9.3.3 and 11.1.2.1. We're using DATAEXPORT files to compare data between the 2 different versions. No dataexport options are currently being set so default options are being used. We currently see differences in

  • Trouble viewing some flash players on safari

    Hi, i've had trouble for two days watching zshare videos via stream, i've tried the same video file on firefox and it works but on safari it doesn't work. I've reset safari, did the update, reinstalled flash on my mac and still the same issue. below

  • Having Problems with Adobe Premiere Pro CC

    Alright, So I downloaded and installed the Creative Cloud. I'm trying to download the Adobe Premiere Trail because I'm thinking of buying the product. However, After waiting so *******(Excuse the language, you have no idea how frustrating it is) long