Populate input array with spreadsheet values

Is it possible to populate an input array with values from a text or spreadsheet file? If so, how is it done?
Solved!
Go to Solution.

Hi Joseph,
"to be more exact":
load the [text] file and use "spreadsheet string to array" (older LV versions) or use "read spreadsheet file" (LV8+)
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome

Similar Messages

  • Fill array with Hue values

    Trying to build (simple) color palette, but keep getting ArrayIndexOutOfBoundsException: 0 when trying to fill the array with Hue values (Saturation and Brightness remain 100%):
    private Color[] hsb = new Color[numberOfCircles];
    float h=0;
    float raise=(1.f/numberOfCircles);
    for (int i=0; i<stKrogcev; i++) {
        hsb=Color.getHSBColor(h,1.0f,1.0f); //getHSBColor: "Creates a Color object based on the specified values for the HSB color model."
    h+=raise;
    }What am I doing wrong?
    What other way could you fill array (Color, int, float, ...) with Hue values?
    This is what I have thus far (only colors missing; not sure whether Sun supports images):  [http://www.shrani.si/f/1G/uM/v29MKIC/palette.jpg]. First three columns in the right-hand table are awaiting RGB values respectively, the last column gets Hue value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    pbrockway2, numberOfCircles (or stKrogcev ) is an int, and is NOT zero. That Color[] hsb is zero.
    import javax.swing.*;
    import java.awt.*;
    public class BarvnaPaleta {
         public static void main (String[] args) {
              System.out.print("Stevilo krogcev: ");
              int n = BranjePodatkov.preberiInt(); // BranjePodatkov: just some custom class for reading input
              Okno o = new Okno(n);
              o.setVisible(true);
    class Okno extends JFrame {
         RisalnaPlosca risalna;
         public Okno(int n) {
              setTitle("Barvna Paleta");
              setSize(1200,900);
              setLocation(0,0);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              risalna = new RisalnaPlosca(n);
              add(risalna);
    class RisalnaPlosca extends JPanel {
         private final int ROB = 300;     
         int     stKrogcev;
         private int izhX, izhY;     
         private int     r1;
         private int     sirina = 60;     
         private int     visina = 20;     
         private double x, y, r2, r3;     
         private double vmesniKot;
         private double polovicaVmesnegaKota;
         //the much needed color arrays
         public Color[] hsb = new Color[stKrogcev];     
         private String[] red = new String[stKrogcev];     
         private String[] green = new String[stKrogcev];     
         private String[] blue = new String[stKrogcev];     
         public RisalnaPlosca(int n) { //constructor     
              stKrogcev = n;
              setBackground(Color.white);
         public void paintComponent(Graphics g) {
              super.paintComponent(g);
              izhX = getWidth()/2 -r1;
              izhY = getHeight()/2 -r1;          
              vmesniKot=(2*Math.PI/stKrogcev);
              polovicaVmesnegaKota=(vmesniKot)/2;          
              r1=getHeight();
              r3=(r1*Math.sin(polovicaVmesnegaKota))/(1+Math.sin(polovicaVmesnegaKota));
              r2=r1-r3;                    
              narisiKrog(g);
              napolniHSB(g); //  LINE 53
              narisiKrogce(g);
         private void narisiKrog(Graphics g) { //draw the BIG Circle
              g.setColor(Color.BLACK);
              g.drawOval(0, 0, r1, r1);
         private void narisiKrogce(Graphics g) { //draw small circles (as many as user wants, max. is 256 of Hue values!
              for(int i=0; i<stKrogcev; i++) {
                   x=(r2/2)*(Math.cos(vmesniKot*i)+1);
                   y=(r2/2)*(Math.sin(vmesniKot*i)+1);
                           //can't use below two because of the "fillHSB"=="napolniHSB" method not working
                   //Color c = new Color(Integer.parseInt(red),Integer.parseInt(green[i]),Integer.parseInt(blue[i]));
                   //g.setColor(c);
                   g.drawOval((int)x, (int)y, (int)r3, (int)r3);
                   narisiLegendo((int)x,(int)y, i, g); //draw a legend (last method)
         private void napolniHSB(Graphics g) { //fillHSB method
    float h=0, raise=1.0f/stKrogcev;
    for (int i=0; i<stKrogcev; i++) {
    hsb[i]=Color.getHSBColor(h,1.0f,1.0f); // LINE 75
    red[i]=Integer.toString(hsb[i].getRed()); // this and below two for converting HSB/HSL into RGB
    green[i]=Integer.toString(hsb[i].getGreen());
    blue[i]=Integer.toString(hsb[i].getBlue());
    h+=raise;
         private void narisiLegendo(int x, int y, int i, Graphics g) { //draw a legend, i.e. 4 right columns
    //can't use drawString as there are no color arrays (yet)
                   g.drawLine((int)(x+r3/2),(int)(y+r3/2),getWidth()-ROB,(visina+i*visina)+visina/2);
                   g.drawRect(getWidth()-ROB, (visina+i*visina), sirina, visina); //Red
                   //g.drawString(red[i], getWidth()-ROB, (visina+i*visina));
                   g.drawRect(getWidth()-ROB+sirina, (visina+i*visina), sirina, visina); //Green
                   //g.drawString(green[i], getWidth()-ROB, (visina+i*visina));
                   g.drawRect(getWidth()-ROB+2*sirina, (visina+i*visina), sirina, visina); //Blue
                   //g.drawString(blue[i], getWidth()-ROB, (visina+i*visina));
                   g.drawRect(getWidth()-ROB+3*sirina, (visina+i*visina), sirina, visina); //Hue
                   //g.drawString(, getWidth()-ROB, (visina+i*visina));

  • How to populate an array with random text files.

    I am making a Jeopardy program. I have my program set up so that it retrieves 5 random text files. I just want to know how I populate one array with all the lines from the text files my program is retrieving.

    You can read a textfile line by line and add each line to an ArrayList. An ArrayList is very much like an array only that it's "open ended". You can start adding lines without first knowing how many you're going to get. If you still want an ordinary "static" array when you're finished reading lines you can easily get one from the ArrayList and then drop the ArrayList.

  • How to read the 'Input help with fixed values' of domain .

    How to read the 'Input help with fixed values' of domain .
    The domain has a Value range i want to read those values .
    Are these values stored in any table ?
    Plz help me i need it ver badly...
    Thanks in Advance...

    Hi Chandra Shekhar,
    To read the 'Input help with fixed values' of domain , you can use the function module : HR_P_GET_FIXED_VALUE_TEXT.
    iIf you enter the domain name, you will find the fixed values entered in the domain.
    These values are stored in a table DD07L(DD zero 7 L). Here the values are stored based on domain name.
    See if it works for you.
    Award points if its helpful.
    Regards,
    Bhanu

  • Search Array with multiple values

    Hello,
    I've been helped with the prototype below by blemmo (thanks).
    It allows me to search my array using one property == a
    value.
    Now, I'd like to use it to:
    if ((prop1 == val1) &&(prop2 == val2) &&
    (prop3 == val3) {
    // search array for all values in array with the values of
    val1, val2 and val3
    Also, a way to search if one of the prop and val's are blank,
    ie...
    ((prop1 == val1) &&(prop2 == val2) && (prop3
    == val3)
    where prop2 and val2 are "undefined"
    so the search will only search for the prop and val that are
    not "undefined"
    make since? Don't know where to start.
    help and thanks in advance.

    it is an array like this.. but with more properties... also,
    is it better to use XML to load large arrays or is it ok to use
    actionscript in the file.
    which is faster to load? say if I had an array of 150
    elements?
    myArray = [{myname:"bob", county:"skagit", city:"Sedro
    Woolley", id:1,
    pic:"1.jpg",pic1:"2.jpg",pic2:"3.jpg",pic3:"4.jpg"},
    {myname:"bob", county:"skagit", city:"Sedro Woolley", id:1,
    pic:"1.jpg",pic1:"2.jpg",pic2:"3.jpg",pic3:"4.jpg"

  • Can java quickly produce an  array with specified values?

    In Fortran I can quickly generate an array by typing
    Dimension SMF(20,2)
    DATA SMF/25*1.,3*0.,9*1.,3*0./
    this creates SMF with the value 1 in allocations 1 to 25, 0 in 26 to 27 and so on .
    Is there a way for java to do this ?

    Not necessarily. Maybe you can write a general Matrix type (an interface) and then write an implementation of Matrix in which its values are specified by an algorithm. So maybe your code would have lines like:
    Matrix m1 = new InitWithHardcodedValuesMatrix("{ { 1 2 } { 3 4 }}");
    Matrix m2 = new InitWithFormulaMatrix("/25*1.,3*0.,9*1.,3*0./");Or maybe someone has already done this. Have you tried Google?
    Anyway, the primary purpose of Java is not formula translation, so it's not surprising that it doesn't have this kind of thing built into the standard libraries.

  • How to dynamically populate a listbox with the values in the database

    Hi,
    How do dynamically populate the list box with the values in the oracle database. I want to load the list box at run time.Plz anybody help me out to find a solution for this problem.
    Thanks in advance...
    Regards,
    Shiva.

    u can wite code like this..on jsp page
    <%
    ResultSet rs = stmt.executeQuery("select vender_name from vendors");
    %>
    <select name = "vendorlist">
    <%
    while(rs.next()){
    String vname = rs.getString(1);
    %>
    <option value="<%=vname%>"><%=vname%></option%>
    <%
    rs.close();
    %>

  • Populate target table with default value

    I have a query like this:
    SELECT 0 AS ID,
    9999999999 AS CODE
    FROM DUAL
    UNION ALL
    SELECT VEH.TP_ID AS ID,
    VEH.VEH_ID AS CODE
    FROM TB_VEHICLE;
    So I have an interface with two data sets, one for each query.
    The first data set represents the "select from dual" "constant values" and the second represents the "select * from tb_vehicle".
    In the first data set I don´t have a source, then ODI generates a select without a table "select 0 AS ID, 99999 AS CODE FROM".
    Any ideas on how can I achieve my objective? I need to populate one row on target table with constant values.
    Thanks

    Alternatively , try this :
    Duplicate the LKM and IKM you are using, create copies , something like LKM xyz (No Source) , IKM xyz (No Source).
    Then adust the KM steps accordingly, remove the 'FROM' part and replace with VALUES ( ) , keeping the odiref substitution call in the parenthesis.
    So you basically have a knowlede module that accepts no source data, generating :
    insert into C$
    (col 1, col 2, col 3 etc)
    VALUES
    (Target mapping 1, target mapping 2, target mapping 3 etc)
    I've seen it done, nice and tidy, keeps all the lineage in ODI etc.

  • How to populate smart form with new values

    Hi!
    I am new to smart form . Can anybody help me in how to populate smart form with some new fileds. Actually i have to populate credit memo form with some customized values..

    Hello,
    Please elaborate your query more in order to be comprehendable.
    Regards,
    Shehryar

  • Build an array with 2 values assigned to 1 dimension

    I am wanting to build a 1D array where two values are assigned to each dimension.  For example:
    Index 0 would have a 1 and 4 assigned to it
    Index 1 would have a 2 and 3 assigned to it
    Index 2 would have a 0 and 1 assigned to it.
    Then I can unbundle this arrayand grab the two values for index 0, index 1, etc....  I want to put this array inside a typedef control.  Is this possible?
    Solved!
    Go to Solution.

    Thanks for the replies.  I considered using a cluster and had the typedef control modified to include the cluster.  I may just go back to this method if this is the simplest for the code I am modifiing.
    A 2D array assigns two values i.e. row and column to one number.  I need it the other way around.
    Here is what I am trying to do.  I need to control a rotary valve.  I am using compact filedpoint to control the rotary valve.  The valve requires a pulse (1 then 0) for the rotary valve to move 1 position. If the valve is on channel 1 of the fieldpoint module and I want it to turn to position 2, the I send two pulses to channel 1. 
    My thinking is I will have two values associated per rotary valve... a channel and a pulse value. So for example, valve 0 has a Boolean and a numeric value assigned to it in an array. Although, it doesn't have to be a boolean and a numeric.  it could be 2 numeric values for simplicity.
    I hope this makes sense because without knowing this posting a VI or image is useless.  Its the chicken before the egg thing. :-)

  • Problem with 'Word edit cell.vi' , Inputs transduced with the value of every row repeated

    Hello,
    Im using LV2013 with office 2013 report tool kit. I am trying to use Word edit cell to input values in table previously created in template .doc.
    Indeed, i trying the example Generate report from template and didnt works well. I search for solution and I see it was a problem with previous version but it seems not solve totally in this version for word office 2010. 
    http://digital.ni.com/public.nsf/allkb/4041ECB5D02BA57D862579A00002FE8D
    I checked this thread but i didnt get it to works. http://forums.ni.com/t5/LabVIEW/Problem-with-append-table-and-Word-2010/m-p/2190960#M702610
    Any way to solve it?.
    Thanks for help.
    Fred
    Attachments:
    error.png ‏32 KB
    Untitled 1.vi ‏19 KB
    exampleTemplate.doc ‏37 KB

    Hello, I solve it adding this to Word_insert_Table.
    http://forums.ni.com/t5/LabVIEW/Report-Generation-MS-Word-Table-Bug/td-p/1605170
    Thanks.
    Open [LabVIEW installation folder]\vi.lib\addons\_office\_wordsub.llb\Word_Insert_Table.vi
    There is a nested for loop that interprets the provided string array data and reformats it into a long ASCII string for the copy buffer. It should look like this:
    Change the nested loop to look like this:
    The changes I've made are twofold:
    1. Within the inner loop, replace the "\n" char with a Tab character
    2. Just after the inner loop, add a new "concatenate strings" function that adds "\n".

  • Strange issue with POF: byte array with the value 94

    This is a somewhat strange issue we’ve managed to reduce to this test case. We’ve also seen similar issues with chars and shorts as well. It’s only a problem if the byte value inside the byte array is equal to 94! A value of 93, 95, etc, seems to be ok.
    Given the below class, the byte values both in the array and the single byte value are wrong when deserializing. The value inside the byte array isn’t what we put in (get [75] instead of [94]) and the single byte value is null (not 114).
    Pof object code:
    package com.test;
    import java.io.IOException;
    import java.util.Arrays;
    import com.tangosol.io.pof.PofReader;
    import com.tangosol.io.pof.PofWriter;
    import com.tangosol.io.pof.PortableObject;
    public class PofObject1 implements PortableObject {
         private byte[] byteArray;
         private byte byteValue;
         public void setValues() {
              byteArray = new byte[] {94};
              byteValue = 114;
         @Override
         public void readExternal(PofReader reader) throws IOException {
              Object byteArray = reader.readObjectArray(0, null);
              Object byteValue = reader.readObject(1);
              System.out.println(Arrays.toString((Object[])byteArray));
              System.out.println(byteValue);
              if (byteValue == null) throw new IOException("byteValue is null!");
         @Override
         public void writeExternal(PofWriter writer) throws IOException {
              writer.writeObject(0, byteArray);
              writer.writeObject(1, byteValue);
    Using writer.writeObjectArray(0, byteArray); instead of writer.writeObject(0, byteArray); doesn't help. In this case byteArray would be of type Object[] (as accessed through reflection).
    This is simply put in to a distributed cache and then fetched back. No EPs, listeners or stuff like that involved:
         public static void main(String... args) throws Exception {
              NamedCache cache = CacheFactory.getCache("my-cache");
              PofObject1 o = new PofObject1();
              o.setValues();
              cache.put("key1", o);
              cache.get("key1");
    Only tried it with Coherecne 3.7.1.3.
    Cache config file:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
         <caching-scheme-mapping>
              <cache-mapping>
                   <cache-name>my-cache</cache-name>
                   <scheme-name>my-cache</scheme-name>
              </cache-mapping>
         </caching-scheme-mapping>
         <caching-schemes>
              <distributed-scheme>
                   <scheme-name>my-cache</scheme-name>
                   <service-name>my-cache</service-name>
                   <serializer>
                        <class-name>
                             com.tangosol.io.pof.ConfigurablePofContext
                        </class-name>
                        <init-params>
                             <init-param>
                                  <param-type>string</param-type>
                                  <param-value>pof-config.xml</param-value>
                             </init-param>
                        </init-params>
                   </serializer>
                   <lease-granularity>thread</lease-granularity>
                   <thread-count>10</thread-count>
                   <backing-map-scheme>
                        <local-scheme>
                        </local-scheme>
                   </backing-map-scheme>
                   <autostart>true</autostart>
              </distributed-scheme>
         </caching-schemes>
    </cache-config>
    POF config file:
    <?xml version="1.0"?>
    <pof-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://xmlns.oracle.com/coherence/coherence-pof-config"
         xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-pof-config coherence-pof-config.xsd">
         <user-type-list>
              <!-- coherence POF user types -->
              <include>coherence-pof-config.xml</include>
              <user-type>
                   <type-id>1460</type-id>
                   <class-name>com.test.PofObject1</class-name>
              </user-type>
         </user-type-list>
    </pof-config>

    Hi,
    POF uses certain byte values as an optimization to represent well known values of certain Object types - e.g. boolean True and False, some very small numbers, null etc... When you do read/write Object instead of using the correct method I suspect POF gets confused over the type and value that the field should be.
    There are a number of cases where POF does not know what the type is - Numbers would be one of these, for example if I stored a long of value 10 on deserialization POF would not know if that was an int, long double etc... so you have to use the correct method to get it back. Collections are another - If you serialize a Set all POF knows is that you have serialized some sort of Collection so unless you are specific when deserializing you will get back a List.
    JK

  • Populate OIM Lookup With Database Values

    I am trying to figure out a way to populate a lookup in OIM with values from an Oracle database. For example, I have a table containing a list of departments with their department ID. I would like to pull these values into a lookup.
    The AD connector's GroupReconTask is very similar to what I want to accomplish. I'm hoping to be able to create an adapter or task that will do something similar.
    Has anyone been successful in attempting something like this or knows of a possible way?

    You need to write a Java class extending com.thortech.xl.scheduler.tasks.SchedulerBaseTask. Use Thor.API.Operations.tcLookupOperationsIntf's methods addLookupValue/updateLookupValue to add/update the lookup values. Check out the Javadoc for more on the same.
    Here is the doc link on how to create a schduled task -> http://download.oracle.com/docs/cd/B32479_01/doc.903/b32453/oimadm.htm#sthref302

  • Input parameter with default value, in OWB 10r2

    -I have a flow that load data from a determinate date, that date is a parameter. This flow is controled to be execute diary by a database job, And takes the parameter as sysdate.
    But I want that a user can set an determined date as input and override the default. (sysdate)
    I created a parameter in the START element , and set
    value as: TO_CHAR(sysdate,'dd-mm-yyyy'))
    The problem is that when the job execute the flow, an oracle error appear:
    ORA-01858: a non-numeric character was found where a numeric was expected ORA-02063: preceding line from FAMISANA@SOU_SEI_LOCATION1
    When I execute the flow and set a parameter input any date (21/07/2001) , thats works.
    So, how can I set the input parameter for have default a sysdate ?
    So thanks

    value as: TO_CHAR(sysdate,'dd-mm-yyyy'))You have created parameter as date then why you are converting it into char.
    and you can check the date format for you database also.
    Cheers
    Nawneet

  • How do I populate an array with a directory listing.

    I have a web site that has its photos updated by another person using a content management system that I have written. As Dreamweaver does not know about these extra photos, if I try to
    syncronise the site on my machine for backup purposes, Dreamweaver downloads all 5000+ photos, and this can take upwards of 12 hours if there are no breaks in the connection.
    So I am trying to write a page that creates an array of the existing files on the remote site. It will then do the same on my local site, and by comparing the arrays, will make a list of the new files, and then download these, which will save a lot of time and bandwith charges.
    First I have to read the directory list, using the code below which reads and echos it on screen.
    However, I cannot work out how to populate the required array.
    <?php
        try
        {          /***photo directory ***/
            $it = new directoryIterator('../web/thumbs');
            while( $it->valid())
                  /*** echo if not a dot directory ***/
                if( !$it->isDot() )
    /**** Array creation code needs to go here I think.***/
    echo $it->current()."<br />";
         /*** move to the next element ***/
                      $it->next();
        catch(Exception $e)
            /*** echo the error message ***/
            echo $e->getMessage();
    ?>
    This creates a list of files and displays it on the page.
    How do I store it in an array?
    Howard Walker

    Although not the solution you were looking for, consider the following:
    Click the icon in DW for "Expand to show local and remote sites."  Arrange the remote image directory by "Modified date," Then select all the recent images and GET them.
    I find the above method good enough for occassional synchronization. I also simply ignore broken image links on the testing system.
    If the above is not a solid enough solution, perhaps someone else will write your array function for you. I don't have the time.

Maybe you are looking for

  • How can I book an employee for a training program from PD?

    HI One and All, Hope all of you Doing well... I configured Personal Development and Training Event Management. When I go for Profile Match-up, I found that One employee is lack-off some skills. I have a training program to fill those skills. How can

  • Deploying a program to a user with UAC enabled causes LaunchWith32BitLauncher error and system crash

    We are deploying a program to run as the logged on user on a Win 7 Sp1 client which runs as an EXE silently.  It fails to execute and we believe that it's due to it being blocked by UAC. When we examine the logs we see the following error in the Ccm3

  • HT6146 how to upgrade IOS 4.1 in IPhone 3GS?

    Microsoft Windows 7 Home Premium Edition Service Pack 1 (Build 7601) XFX MG-63MI-7109 iTunes 11.1.4.62 QuickTime not available FairPlay 2.5.16 Apple Application Support 3.0 iPod Updater Library 11.1f5 CD Driver 2.2.3.0 CD Driver DLL 2.1.3.1 Apple Mob

  • File error message when rendering

    hard drive replaced by apple. now when i try to render a previously uploaded video in fce a pop-up says: "file error: access denied." what does this mean? something to do w/ them? how do i get "access" to my file again? never had this problem again.

  • Erfahrung / Probleme mit Paralax Effekt in MUSE und Safari

    Hallo da draußen, ich suche Erfahrungsberichte bzw Hilfe im Umgang mit folgendem Problem. Habe die Website www.bloxmix.de mit MUSE erstellt und Paralax Effekt eingebaut. Mit Firefox, Opera und Chrome funktioniert die Website hervorragend. Nur Safari