A value of reading either excel or a text file

Hello

We are students working on a schoolproject where we want to control some output engines. We want to create a set of input values are in red in our program either excel or a text file.

For example, we want an entry to read the value '1' then the program runs its course and we get a result from the entry '1', after read the next value '2' and the program runs its course and so on.

We looked for clues and answers, but I suppose were really wrong with that. Someone here who could help us?

Less you can see one of our programs, its designed to control 3 fans depending on the input (ppm of CO). We want to replace the 'digital controller"(ppm of CO) in another 'thing' that gives us an entry in a list of values.

Well cordially

Tired students


Tags: NI Software

Similar Questions

  • Need help: UTL_FILE read and write in the text file

    Hello, I'm on version 11 GR 2 by using the UTL_FILE function to read a text file and then write the lines where it starts with the word "foo" and put an end to my writing in the text file where the line with the word "ZEN". Now I have several lines that begin with 'foo' and 'ZEN' allow a paragraph, and in this paragraph, there is a line that begins with "DE4.2". Therefore,.
    I need to write all of the paragraphs that include the "DE4.2" line in their beginning and end of lines 'foo' and 'ZEN '.

    FOR EXAMPLE:

    FOO/234E53LLID
    IT'S MY SECOND LINE
    IT'S MY THIRD LINE
    DE4.2 IT OF MY FOURTH LINE
    IT'S MY FIFTH LINE
    ZEN/DING3434343

    FOO/234E53LLID
    IT'S MY SECOND LINE
    IT'S MY THIRD LINE
    IT'S MY FIFTH LINE
    ZEN/DING3434343

    I'm only interested in writing the first paragraph tha includes line DE4.2 in one of the paragraph of lines not the second ther that does not include the "DE4.2".

    Here is my code so far:

    CREATE OR REPLACE PROCEDURE my_app2 IS
    Utl_file.file_type INFILE;
    outfile utl_file.file_type;
    buffer VARCHAR2 (30000);
    b_paragraph_started BOOLEAN: = FALSE; -flag to indicate which required paragraph is started

    BEGIN
    -Open a file to read
    INFILE: = utl_file.fopen ('TEST_DIR', 'mytst.txt', 'r');
    -Opens a file for writing
    outfile: = utl_file.fopen ('TEST_DIR', "Out.txt", "w");

    -Check the file is open
    IF utl_file.is_open (infile)
    THEN
    -lines in the file in loop
    LOOP
    BEGIN
    UTL_FILE.get_line (infile, buffer);
    APPLICATION STARTING POINT-
    Buffer IF LIKE 'foo %' THEN
    b_paragraph_started: = TRUE;
    END IF;
    -SEARCH FOR GRADS APPS
    IF b_paragraph_started AND buffering LIKE '% 4% ' THEN
    UTL_FILE.put_line (outfile, buffer, FALSE);
    END IF;
    -REQUEST FOR ENDPOINT
    Buffer IF LIKE '% ZEN' THEN
    b_paragraph_started: = FALSE;
    END IF;
    UTL_FILE.fflush (outfile);

    EXCEPTION
    WHEN no_data_found THEN
    EXIT;
    END;
    END LOOP;
    END IF;
    UTL_FILE.fclose (INFILE);
    UTL_FILE.fclose (outfile);
    EXCEPTION
    WHILE OTHERS THEN
    raise_application_error ("-20099, ' UTL_FILE unknown error");
    END my_app2;
    /

    When I run this code I get only one line: DE4.2 it ME LACK THE WHOLE PARAGRAPH

    PLEASE ADVISE...

    I agree with reservations of Justin on the length of a "paragraph" and the number of users that are running at the same time, so here is a version without the collections.

    CREATE or replace PROCEDURE my_app2 IS
       infile utl_file.file_type;
       outfile utl_file.file_type;
       buffer VARCHAR2(30000);
       b_paragraph_started BOOLEAN := FALSE; -- flag to indicate that required paragraph is started
       b_toprint BOOLEAN := FALSE;
       l_para_start pls_integer;  -- start of "paragraph"
    BEGIN
       infile := utl_file.fopen('TEST_DIR', 'mytst.txt', 'r');
       outfile := utl_file.fopen('TEST_DIR', 'out.txt', 'w');
       LOOP
          BEGIN
             utl_file.get_line(infile, buffer);
             IF buffer LIKE 'FOO%' THEN
                b_paragraph_started := TRUE;
                l_para_start := UTL_FILE.FGETPOS(infile) - (length(buffer) + 1);
             END IF;
             IF b_paragraph_started and buffer like '%DE4%' THEN
                b_toprint := TRUE;
             END IF;
             If buffer like 'ZEN%' THEN
                IF b_toprint THEN
                   UTL_FILE.FSEEK(infile, l_para_start);
                   utl_file.get_line(infile, buffer);
                   while buffer not like 'ZEN%' loop
                      utl_file.put_line(outfile,buffer, FALSE);
                      utl_file.get_line(infile, buffer);
                   end loop;
                   utl_file.put_line(outfile,buffer, FALSE);
                end if;
                b_paragraph_started := FALSE;
                b_toprint := false;
                utl_file.fflush(outfile);
             end if;
          EXCEPTION
             WHEN no_data_found THEN
                EXIT;
             END;
       END LOOP;
       utl_file.fclose(infile);
       utl_file.fclose(outfile);
    END my_app2;
    

    Test:

    SQL> !cat mytst.txt
    FOO/234E53LLID
    THIS IS MY SECOND LINE
    THIS IS MY THIRD LINE
    DE4.2 THIS IS MY FOURTH LINE
    THIS IS MY FIFTH LINE
    ZEN/DING3434343
    
    FOO/234E53LLID
    THIS IS MY SECOND LINE
    THIS IS MY THIRD LINE
    THIS IS MY FIFTH LINE
    ZEN/DING3434343
    
    FOO/234E53LLID again
    THIS IS MY second SECOND LINE
    THIS IS MY second THIRD LINE
    DE4.2 THIS IS MY second FOURTH LINE
    THIS IS MY second FIFTH LINE
    ZEN/DING3434343 again
    
    SQL> exec my_app2;
    
    PL/SQL procedure successfully completed.
    
    SQL> !cat out.txt
    FOO/234E53LLID
    THIS IS MY SECOND LINE
    THIS IS MY THIRD LINE
    DE4.2 THIS IS MY FOURTH LINE
    THIS IS MY FIFTH LINE
    ZEN/DING3434343
    FOO/234E53LLID again
    THIS IS MY second SECOND LINE
    THIS IS MY second THIRD LINE
    DE4.2 THIS IS MY second FOURTH LINE
    THIS IS MY second FIFTH LINE
    ZEN/DING3434343 again
    

    You may need to change the length (buffer) + 1 depending on your platform and if you want a blank line s NLE out paragraphs, add another call to put_line after that outside of the loop in the fi l_toprint block.

    John

  • First character left in file by reading the first line in text file

    When you use the function of reading text from a file file, I noticed that the 1st character is left in the file. I read the line correctly.

    When adding a 2nd line this character is in the file.

    Part vi code is attached.

    Any ideas?

    Thank you.

    Elik

    Can you attach a file of real data and tell us what you mean by "first character". The number of characters per line do you have?

    Can you tell us what you see in the modified file and what you expect to see.

    Everything seems good.

    1. Read you the first line and so the file pointer is just after the first line
    2. You set the size of the file at the end (seems unnecessary, because it does nothing). The file pointer is always right after the first line.
    3. You write the first line you read concatenated with a second line. It will be written on the current file pointer, i.e. after the existing line
    4. The first line is in the file twice, as planned.

    Setting the file size to the 'end' on an existing file does not have something useful. If you want to set the position of the file instead?

    Try to set the file position from and new data will be written at the beginning of the file.

  • Reading single line of the text file

    I use the following code to read a .txt file

    private String readTextFile (String fName) {}
    String result = null;
    FileConnection fconn = null;
    DataInputStream is = null;
    try {}
    fconn = (FileConnection) Connector.open (fName, Connector.READ);
    is = fconn.openDataInputStream ();
    Byte [] = IOUtilities.streamToBytes (is) data;
    result = new String (data);
    } catch (IOException e) {}
    System.out.println (e.getMessage ());
    } {Finally
    try {}
    If (null! = is)

    is. Close();
    If (null! = fconn)
    fconn. Close();
    } catch (IOException e) {}
    System.out.println (e.getMessage ());
    }
    }
    return the result;
    }

    I want to print a single line instead of the file around so I read that I need to store the contents of the file into an array and then get the index of the line. Problem is that I couldn't find any information on how to do it. Can someone give me a shot. Thanks in advance.

    This isn't a problem with encoding. You just need to do a little extra accounting and adjust start and end indices to remove these characters. To treat the "\r\n" of line termination style, you can maintain a flag (initially false) to indicate that the previous line ended with a \r; If a line begins with \n, it should be treated as the end of a line (empty) if the flag is true (in which case it should be ignored).

    If you want to extract all lines (not just the first), then it may be easier to do this accounting while avoiding a separate function. Something like this (untested):

    // read the file into a byte array 'data'; then:
    Vector lines = new Vector();
    boolean endCR = false;
    int start = 0;
    for (i = start; i < data.length; ++i) {
      if (data[i] = 0xD) {
        lines.addElement(new String(data, start, i - start));
        endCR = true;
        start = i + 1;
      } else if (data[i] = 0xA) {
        if (endCR && i == start) {
          start++;
          endCR = false;
        } else {
          lines.addElement(new String(data, start, i - start));
          start = i + 1;
        }
        endCR = false;
      }
    }
    String[] results = new String[lines.size()];
    lines.copyInto(results);
    
  • How read text file?

    Hello

    I'm trying to create a simple SWF file in Flash MX that will read the contents of a text file named "file.txt" and displays on the screen. One word is written in this text 'Hello' file, that should be displayed.
    I tried to use the loadVariables function, but somehow, it does not work and nothing prints on the screen.

    It's my first animation flash for more than 6 years (I used for the flash 4 in 1998) so I didn't script before action.

    Please take a look to the queue, I have created by clicking on the URL below and tell me why it is not print anything on the screen after the reading of text file.

    http://ALIWEB-PHP.elixirhost.com/flash_example.zip

    Thank you all

  • How to read formatting excel worksheet as an array of strings

    I use the report tool to read an excel spreadsheet in an array of strings of LV.  It works fine except that it reads the precision of digital cells (~ 10 digits of precision).

    In my workbook I have displayed accuracy the value 2.  Is it possible to read the table such that it is displayed instead of the way it is stored internally?  (BTW, I understand how to do this)

    manually by parsing the string array and limit myself to the accuracy but would prefer to use excel itself to determine accuracy)

    sachsm,

    This should allow you to get the text from a cell or a range of cells.  Sort of do a "paste special" 'values '.

  • I read the excellent instructions, but cannot locate the green arrow to start the download! I did not accidentally remove the arrow, because he was never

    I went on the Mozilla site to download to my Mac. I read the excellent instructions, but cannot locate the green arrow to start the download! I did not remove accidentally the arrow, as it was never there to be seen. I use Safari and don't have Firefox on my MAC (to my knowledge).

    Thank you

    PS: I clicked on the 'automatically add' and downloaded the file, but when I tried to open it, I get the message "Safari cannot read this file. Cool, huh?

    See how to install Firefox on Mac.

    Open the Firefox disk image file and drag the Firefox program into the Applications folder on your hard drive.
    Do not double-click the Firefox to run from the disk image, but instead, drag it out of the DMG file.

  • LabVIEW allows to read an Excel file to a control and add a checkbox for each line

    As say the topic, I need to use labview to read an excel file and show it in a control, such as mclb; I should add a checkbox for each line then allow me to choose the line I want. What should I do? Thank you very much.

    guiming wrote:

    I can read an Excel file to a spreadsheet, but I have no idea how to do to add a checkbox for each line.

    Sometimes, all you need to do is Google. https://decibel.NI.com/content/docs/doc-25000

    http://www.labviewing.com/check-box-in-multicolumn-ListBox/

  • Date and time on the graph (read from Excel)

    Hi everone, I m new to this forum.
    I'm stuck with one of my projects.
    The program is, READ the excel file and it draw on the graph.
    Registered solar energy output is doing, basically I'm trying to see the chart of the outputs and readings at different times.
    I have problem to read time colum, I want to show in the time indicated on the excel on the chart.
    and like 4-5 minutes, to determine the curve because it has 9000 + points.  any suggestion to reduce points?
    I'm new to labview.

    Here's a very quick project on what you could do.

    Of course, you could also extract the headers and place them in the rings for a natural selection more. Only parties with controls belongs in a loop if users should be able to select the columns dynamically. You must also analyze the column time differently. Modify if needed.

  • Read the Excel file

    Hi fellow coders, I need help on the topic of Excel files.

    Process of

    Read the Excel (5 worksheets) file > output is 5 table 2D > Covert table 2D in single array (Colum) > convert (String) data type of data (i/o, digital etc) > build Cluster table with table 2D data.

    I need help to interpret the secret 2D table in single table (Colum) > String convert to the relevant data type > building Cluster table with table 2D data.

    Happy coding

    Dave

    You could do something like this:

  • LabVIEW can read data Excel with Excel installed Starter?

    I'm reading an Excel file, but I get the error-2147221164 try to read an Excel file and I think it's because of starting Excel. Is this the case?

    You probably found this:

    http://digital.NI.com/public.nsf/allkb/B7F980D169474D568625760E0055D55E?OpenDocument

    Who said Excel is not installed, but I think the problem is that Excel Starter (and the word by the way) is a not the component ActiveX.  This is what is used behind the scenes to talk to Excel, and without it, you will get several errors.

    EDIT: I can't seem to find where it says ActiveX is not included, but I remember having read - it somewhere.  Here is the wiki on this topic page.

    http://en.Wikipedia.org/wiki/Microsoft_Office_2010#Starter_Edition

  • Generate a waveform self-defined by reading an excel file

    Hi all

    Now, I'm generating a waveform of salt-defined by a PXI. Attached is a vi I built for the generation of AC signals, in vi, I used a signal generator to a wave of sinnusoidal of generrate of alternative voltages. I guess I can replace this signal generator with a block that can read an excel file which contains instances of time and their corresponding voltage.

    Can you please tell me if this idea works. If it is, block who can do this job?

    Thank you very much.

    Yes you can.

    The easiest is to have Excel to save the data to a CSV file.  Use of spreadsheet file to get data in LabVIEW.

    (Search the forums for Excel.  This question has found thousands of times before).

    I recommend you watch the LabVIEW tutorials online
    LabVIEW Introduction course - 3 hours
    LabVIEW Introduction course - 6 hours

    PS: They are called functions or Subvi, not of 'blocks '.

  • OBIEE 11G: How 'read' an Excel file from the file system?

    I wonder to provide a link to a page of dashboard OBIEE to read an Excel - probably open it in a new window.

    Can what method I use to provide a link to open and read a link to an excel file in a page of OBIEE dashboard?

    Thank you in advance.

    Check this link http://total-bi.com/2011/02/external-files-obiee-dashboard/

    If brand aid

    Thank you
    http://cool-bi.com

    Published by: Srini VIEREN on May 28, 2013 12:06

  • Report and read the Excel file

    Hi all

    I need to match the styles of paragraphs with Indesign and files the Excel file.

    Excel file consists of (approximately 500 paragraph Styles) naming of the files of standard paragraph styles

    Files InDesign with 100 paragraph Styles.

    My request:

    I need to generate the report if Indesign paragraph styles that are not in the Excel file.

    for example,.

    Indesign file Excel file

    h1                             H1

    h2                              h2

    h3                              BL

    tx                              tx1

    TX1

    TX2

    Create the report as:

    Paragraph error style is H1 and BL in Indesign file

    Created script:

    var myDoc = app.activeDocument;
    
    var myPstyles = app.activeDocument.allParagraphStyles;
    
    alert("myPstyles: " + myPstyles.length)
    
    for(i=0; i<myPstyles.length; i++)
    {
         var IndesignPStyles = myPstyles[i].name;
        alert(myPstyles[i].name)
        }
    //_____________________________________________________________
    
    //Help Here
    
    var myFile = File.openDialog("Choose a tab delimitted txt file:");
    if (!myFile){
    exit();
    }     
     
    myFile.open('r');
    while (myFile.eof==false){
         line=myFile.readln();
         line = line.split("\t");
         myFind = line[0];
    }
    
    
    

    Could someone help with this request.

    Thanks in advance

    Beginner_X

    Hi BEGINNER_X,

    First of all, you must convert the excel file to the format of files "*.csv or delimited by tabs. (I use commas .csv file).

    You posted in above code JS reading only the names of paragraph style. Then another code is read only comma-delimited text file, but you are not comparing the paragraph style in the list of excel files. You missed here.

    Please try the JS code below his works very well, but not generated the report file. I hope that you will generate the report of your side file.

    var myFile = File.openDialog("Choose a tab delimitted txt file:");
    if (!myFile){
    exit();
    }     
    
    var myArray = []
    myFile.open('r');
    while (myFile.eof==false){
        var line=myFile.readln().split(",");
        myArray.push(line[0]);
        }
    
    var myDoc = app.activeDocument;
    var myPstyles = app.activeDocument.allParagraphStyles;
    
    Array.prototype.contains = function(obj) {
        var i = this.length;
        while (i--) {
            if (this[i] === obj) {
                return true;
            }
        }
        return false;
    }
    
    var myMissingStyle =[];
    for(i=2; i
    

    THX,

    csm_phil

  • How to read a text file that is longer than 65536 lines and write the data to a spreadsheet Excel and the data to write in a new column, once exhausted 65536 cells in a column?

    I have data to the basic generic text file format that must be converted into Excel spreadsheet format.  The data are much longer than 65536 rows and in my code, I was not able to find a way to see the data in the next column.  Currently, the conversion is done manually and generates an Excel file which has a total of 30-40 complete columns of data.  Any suggestions would be greatly appreciated.

    Thank you

    Darrick

    Here is a possible solution to the (potential) problem. Convert an array of strings and erase the data before writing to the file

Maybe you are looking for