How to append data in array

I use three read waveform nodes to read data from three channels of
oscilloscope. The data of each channel are 1D array, and I use build
array node to change them into 2D array. It can work well now.
When I want to continuously reading data, I put the read waveform nodes
and build array node into a while loop structure(a timer controls the
time when to stop). That means every time, the program calls read
waveform nodes and then changes them into 2D array. The problem is:after
each loop, the data stored in the 2D array are overwrited. So, at last,
I can only get the last loop data.
I want to append the data into the 2D array, but I do not know how to
implement? I have tried put the build array outside the while loop,
unfortunatel
y, it does not work.
Any advice would be appreciated.
Sent via Deja.com http://www.deja.com/
Before you buy.

The shift register is a built in way to carry data forward from one
iteration of a loop to the next iteration.. Anything that you feed into the
right shift register appears a data at the beginning of the next loop. You
already have Build Array to combine three 1D array Elements into a single 2D
array. Use another Build Array function to combine the current 2D array
with the previous 2D array to create a combined array. To do this, you must
change the input mode of the Build Array function to Array (not Element).
This will concatenate the arrays and make the continuous data that you are
after.
The only other hidden step is that you must use Initialize Array to feed a
blank, 2D array into the left shift register to clear any leftover data.
Michael Munroe Mailto:[email protected]
A Better Complete Development Engineering Firm
San Mateo, CA 94403 http://www.abcdefirm.com
[email protected] wrote:
> Because I am very new to Labview and in fact, English is not my native
> language, I can not understand the sentence that "combine the current
> reading with the previous reading from the left shift register and save
> it back to the right shift register" means.
>
> Now, I want to descript my question in a simple way:
> In a while loop, I use a build array node to build three 1D arrays into
> one 2D array. For each time when while loop repeats, the value of these
> 1D arrays change, I want to append the new data to the previous ones.
> But in my program, the data in the build array are overrided after the
> while loop repeating.
> So, How to append the data instead of overriding them in the while loop
> structure?
>
> Thanks a lot!
>
> zhljh
>
> In article <[email protected]>,
> Michael Munroe wrote:
> > You need to combine the build array function with the shift register.
> Pop
> > up on the edge of the loop and Add Shift Register. You can combine the
> > current reading with the previous reading from the left shift register
> and
> > save it back to the right shift register.
> > --
> > Michael Munroe Mailto:[email protected]
> > A Better Complete Development Engineering Firm
> > San Mateo, CA 94403 http://www.abcdefirm.com
> >
> > [email protected] wrote:
> >
> > > I use three read waveform nodes to read data from three channels of
> > > oscilloscope. The data of each channel are 1D array, and I use build
> > > array node to change them into 2D array. It can work well now.
> > > When I want to continuously reading data, I put the read waveform
> nodes
> > > and build array node into a while loop structure(a timer controls
> the
> > > time when to stop). That means every time, the program calls read
> > > waveform nodes and then changes them into 2D array. The problem
> is:after
> > > each loop, the data stored in the 2D array are overwrited. So, at
> last,
> > > I can only get the last loop data.
> > > I want to append the data into the 2D array, but I do not know how
> to
> > > implement? I have tried put the build array outside the while loop,
> > > unfortunately, it does not work.
> > > Any advice would be appreciated.
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> >
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Michael Munroe, ABCDEF
Certified LabVIEW Developer, MCP
Find and fix bad VI Properties with Property Inspector

Similar Messages

  • Datapump : How to append data in an existing table

    Hello Everyone,
    We are new to Datapump.
    We try to extract data from one user/schema and to append it into another user/schema.
    First we tried Tt use the parameter table_exists_action=append during the importation but we receive this error (but the rows are appended):
    ORA-39152: Table "XXXXX"."YYYYY_ZZZ" exists. Data will be appended to existing table but all dependent metadata will be skipped due to table_exists_action of append
    Which I don't expect since the utility have been told to, indeed, append data.
    Next we tried to use CONTENT=DATA_ONLY on exportation and importation but the importation never end.
    How can we append data into a table's user/schema without having an error?
    Best regards.
    Carl

    IGNORE=Y during the import.it does the same operation. if the table already exists,it ignores and proceed with importing/appending data to the tables. same way, they do have indexes=n and constraints=n option.
    both export/import have equivalent options for fitering to our requirement and datapump has one step above classic import in which you can filter upto metadata object as well.

  • How to append data in same log after start and stop signal express

    how can i append my data to the same log file after starting and stopping the signal express ? Is there some option to do this. After start/stop it always makes a new log file. How can append datat to the same log file. 
    Thanks in advance. 
    Munir

    Hello mbhatti,
    I founded a KB which seems do describe the way to solve your problem.
    Appending Data to the Same File when Logging in LabVIEW SignalExpress :
    http://digital.ni.com/public.nsf/allkb/C38AEE499D5CC8C6862572CF006875D2?OpenDocument
    I hiope this will help you
    Regards
    Florian Abry
    Application Engineer Group Leader
    NI Germany

  • How to append data  runtime in Table in MIDlet

    Hi Friends,
    i am having 2 queries..
    1st:: How can i append data runtime in table in MIDlet ( like web )which are coming from Database.
    2: requirement is that 1st row of table should for headings like StartDate,EndDate,Resources and Status.
    From the 2nd row ,Columns for runtime data.(Like any Table how u all got my query).
    Plz send me reply as early as possible.
    Waiting for reply
    Best regards
    karan

    Presently you cannot use AJAX kind of stuffs in J2ME.
    If you want to achieve the functionality better to look at articles wriiten on writing custom items in J2ME. That will help you achieve the kind of requirement that you are expecting.
    ~Mohan

  • How to append to an array

    i have a true false case inside a loop and each time
    it pases through a false case . i pull out one value from the array(external). i would like to know if some one can help me in telling me how to append an element to an exisiting array or to create a array inside the false case structure.
    THanks
    Attachments:
    append.vi ‏42 KB

    hello, well, I dun really understand what you wanna do. Here's my guess. Hope it helps
    Cheers
    ian.f k
    SG/MY
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com
    Attachments:
    buildarray.vi ‏27 KB

  • How to append data from different import files?

    Dear experts,
    The customer is having different applications running that will output imports files BPC needs at a different time of process. Is it possible to append data which already exist in BPC from import?
    eg. BPC already has a record
    Factory1, Actual, 2008.OCT, Movement1, 30
    import file-
    Factory1, Actual, 2008.OCT, Movement1, 100
    and I need to add them up to become 130.
    Looks like regular import will only replace the original record by the new imported value. I'm still trying...
    Thanks a lot,
    Jim Hsu

    I do not think there is a way to use a standard import package to perform this action.  Typically when you are importing, you are saying this is the new value.  Not increment/decrement the value. 
    I have never had to implement a solution for a problem like this.  However, I would write a custom SSIS package that would extract the BPC data for the same dimensionality being imported and append it with the import file, then import the combined file.  Values sharing the same dimensionality in the same import file are aggregated on the actual import.
    SO your input file has 30, the export gets 100, the combined file has both and the actual value imported would be 130.
    That would be the approach I would take, but others might have more experience in different areas.

  • How to append data in column

    Hi ,
    I have One Column Name in Emp table Now name is varchar2(100) Now i n name column only first name exists now I wants to append surname in column without using update statement as column consist of first name i wants to append surname so please do advise how to append in column in oracle
    appriciate help.
    thanks

    You need something like this:
    UPDATE table_name
    SET ename=ename||' '||surname
    WHERE .....

  • How to append data in xml

    I have below script which will create xml with data.
    ======================================================================
    $xmlPath = "D:\Users\admin\Desktop\Report.xml"
    $date = Get-Date -UFormat %m/%d/%Y
    if ( ! ( Test-Path $xmlPath ) )
        # Create The XML
        $global:xmlWriter = New-Object System.XMl.XmlTextWriter($xmlPath,$Null)
        $global:xmlWriter.Formatting = "Indented"
        $global:xmlWriter.Indentation = "4"
        $global:xmlWriter.WriteStartDocument()
        $global:xmlWriter.WriteStartElement("Execution")
        $global:xmlWriter.WriteStartElement("ExecutedOn")
        $global:xmlWriter.WriteAttributeString("Date",$date)
        $global:xmlWriter.WriteStartElement("Environments")
        Foreach( $c in $cEnvironments)
            $global:xmlWriter.WriteStartElement($c.Environment)
            $global:xmlWriter.WriteAttributeString("Red",$c.Red)
            $global:xmlWriter.WriteAttributeString("Green",$c.Green)
            $global:xmlWriter.WriteAttributeString("Blue",$c.Blue)
            $global:xmlWriter.WriteEndElement() #end of $c.Environment
        $global:xmlWriter.WriteEndElement() #end Environments
        $global:xmlWriter.WriteStartElement("ClEnv")
        Foreach( $c1 in $clEnv)
            $global:xmlWriter.WriteStartElement($c1.Environment)
            $global:xmlWriter.WriteAttributeString("John",$c1.John)
            $global:xmlWriter.WriteAttributeString("Mike",$c1.Mike)
            $global:xmlWriter.WriteAttributeString("Alex",$c1.Alex)
            $global:xmlWriter.WriteEndElement() #end of $c1.Environment
        $global:xmlWriter.WriteEndElement() #end ExecutedOn
        $global:xmlWriter.WriteEndElement() #end execution
        $global:xmlWriter.WriteEndDocument() #end document
        $global:xmlWriter.Finalize
        $global:xmlWriter.Flush()
        $global:xmlWriter.Close()
    else
        here I need to append the data in existing xml with the same above info but with different value
    $cEnvironments $clEnv variables are array and having related data. Now I need to re run the script next day and check if the file is already exist. this is I am doing with if command. if it is already exist then using "else" I need to append the data
    in existing xml with the same above info but with different values under section "Execution" like given below
    ======================================================================
    <?xml version="1.0"?>
    <?xml-stylesheet type='text/xsl' href='style.xsl'?>
    <Execution>
        <ExecutionStarted Date="2/19/2014">
         <Environments1>
            <Colors Red="21" Blue="14" Green="18" />
        </Environments1>
        <Environments2>
            <Names John="21" Mike="14" Alex="18" />
        </Environments2>
    </ExecutionStarted>
    <ExecutionStarted Date="2/20/2014">
         <Environments1>
            <Colors Red="2" Blue="56" Green="76" />
            <Colors Cyan="31" Brown="32" Black="54" />
        </Environments1>
        <Environments2>
            <Names John="45" Mike="63" Alex="97" />
        </Environments2>
    </ExecutionStarted>
    </Execution>
    Thanks.

    I have below script which will create xml with data.
    ======================================================================
    $xmlPath = "D:\Users\admin\Desktop\Report.xml"
    $date = Get-Date -UFormat %m/%d/%Y
    if ( ! ( Test-Path $xmlPath ) )
        # Create The XML
        $global:xmlWriter = New-Object System.XMl.XmlTextWriter($xmlPath,$Null)
        $global:xmlWriter.Formatting = "Indented"
        $global:xmlWriter.Indentation = "4"
        $global:xmlWriter.WriteStartDocument()
        $global:xmlWriter.WriteStartElement("Execution")
        $global:xmlWriter.WriteStartElement("ExecutedOn")
        $global:xmlWriter.WriteAttributeString("Date",$date)
        $global:xmlWriter.WriteStartElement("Environments")
        Foreach( $c in $cEnvironments)
            $global:xmlWriter.WriteStartElement($c.Environment)
            $global:xmlWriter.WriteAttributeString("Red",$c.Red)
            $global:xmlWriter.WriteAttributeString("Green",$c.Green)
            $global:xmlWriter.WriteAttributeString("Blue",$c.Blue)
            $global:xmlWriter.WriteEndElement() #end of $c.Environment
        $global:xmlWriter.WriteEndElement() #end Environments
        $global:xmlWriter.WriteStartElement("ClEnv")
        Foreach( $c1 in $clEnv)
            $global:xmlWriter.WriteStartElement($c1.Environment)
            $global:xmlWriter.WriteAttributeString("John",$c1.John)
            $global:xmlWriter.WriteAttributeString("Mike",$c1.Mike)
            $global:xmlWriter.WriteAttributeString("Alex",$c1.Alex)
            $global:xmlWriter.WriteEndElement() #end of $c1.Environment
        $global:xmlWriter.WriteEndElement() #end ExecutedOn
        $global:xmlWriter.WriteEndElement() #end execution
        $global:xmlWriter.WriteEndDocument() #end document
        $global:xmlWriter.Finalize
        $global:xmlWriter.Flush()
        $global:xmlWriter.Close()
    else
        here I need to append the data in existing xml with the same above info but with different value
    $cEnvironments $clEnv variables are array and having related data. Now I need to re run the script next day and check if the file is already exist. this is I am doing with if command. if it is already exist then using "else" I need to append the data in existing
    xml with the same above info but with different values under section "Execution" like given below
    ======================================================================
    <?xml version="1.0"?>
    <?xml-stylesheet type='text/xsl' href='style.xsl'?>
    <Execution>
        <ExecutionStarted Date="2/19/2014">
         <Environments1>
            <Colors Red="21" Blue="14" Green="18" />
        </Environments1>
        <Environments2>
            <Names John="21" Mike="14" Alex="18" />
        </Environments2>
    </ExecutionStarted>
    <ExecutionStarted Date="2/20/2014">
         <Environments1>
            <Colors Red="2" Blue="56" Green="76" />
            <Colors Cyan="31" Brown="32" Black="54" />
        </Environments1>
        <Environments2>
            <Names John="45" Mike="63" Alex="97" />
        </Environments2>
    </ExecutionStarted>
    </Execution>
    Thanks.
    In my opinion, you are creating difficulties when you treat the problem as [xml] objects.
    A XML file is in fact, a TXT file, which can be interpreted in a specific way (XML way).
    But to this current problem, you can view the XML file as a common TXT file, with 1 important requirement: the closing main node ( </Execution> in your example ) must be in its own line, and must be the last line in the file.
    That said, you accomplish your task successfully, with this pretty much simple PS code:
    $xmlFile='.\XML.xml'
    $oldXmlText=@(gc $xmlFile)
    $newXmlText=$oldXmlText[0..($oldXmlText.Count-2)]+
    $inclusion+
    $oldXmlText[-1]
    Just compare this simplicity, with you original code's complexity.
    The XML.xml file content can be this:
    <?xml version="1.0"?>
    <?xml-stylesheet type='text/xsl' href='style.xsl'?>
    <Execution>
        <ExecutionStarted Date="1">
            <Environments1>
                <Colors Red="21" Yellow="14" Green="18" />
            </Environments1>
            <Environments2>
                <Names John="21" Mike="14" Alex="18" />
            </Environments2>
        </ExecutionStarted>
    </Execution>
    Notice the very last line.
    And the variable $inclusion can be this:
    $inclusion=@'
       <ExecutionStarted Date="2">
            <Environments3>
                <Names blue="21" black="14" cyan="18" />
            </Environments3>
       </ExecutionStarted>
    My Friend Come See How Abject Repugnant Politics... r.

  • How to bring data from arrays into xy-graph?

    Hello,
    i have some data which is currently stored in two arrays. One array with values and another array with timestamps.
    Now my questions is how can i bring/convert these into the format of XY-graph?
    Thanks for help.

    Hi One,
    - Why do you use a InsertIntoArray when you want to append new plots to an array of plots? Use BuildArray!
    - Why do you initialize your shift register to already contain (atleast) one plot?
    - Why do you use a shift register at all? Why not rely on the autoindexing output tunnel? 3 iterations will yield 3 plots easily…
    - Why don't you clean up your VI before uploading?
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to append data..

    I have an requirement where in transaction MIGO. when user clicks on POST button, at that time the data should be e-mailed to the Vendor.
    So for that i have created a Z implementation of BADI MB_MIGO_BADI.
    Now in that i have written a Function Module name as Z_SENDMAIL.
    where i have table paramater which is of type BCSY_TEXT which is again of LINE type of SOLI.
    Now the data of MIGO is filled in table IT_MSEG which is paramter of Method POST_DOCUMENT of MB_MIGO_BADI.
    So problem comes that how should i fill the data in my line type table of Function Module.
    For your information i am sending you the FM.
    FUNCTION Z_SENDMAIL.
    ""Local Interface:
    *" IMPORTING
    *" VALUE(FROM) TYPE ADR6-SMTP_ADDR OPTIONAL
    *" REFERENCE(TO) TYPE ADR6-SMTP_ADDR OPTIONAL
    *" REFERENCE(SUBJECT) TYPE SO_OBJ_DES
    *" REFERENCE(FLAG) TYPE CHAR1 OPTIONAL
    *" EXPORTING
    *" REFERENCE(RETURNCODE) TYPE SY-SUBRC
    *" TABLES
    *" IT_TEXT TYPE BCSY_TEXT
    *" IT_EMAILS STRUCTURE SOMLRECI1 OPTIONAL
    TYPES : BEGIN OF TS_REC,
    RECIPIENT TYPE REF TO IF_RECIPIENT_BCS,
    END OF TS_REC.
    DATA : IS_T1(255) TYPE C,
    IT_REC TYPE TABLE OF TS_REC,
    IS_REC TYPE TS_REC,
    W_EMAIL TYPE ADR6-SMTP_ADDR,
    W_TEXT TYPE BCSY_TEXT,
    W_DOCUMENT TYPE REF TO CL_DOCUMENT_BCS,
    W_SENDER TYPE REF TO IF_SENDER_BCS,
    W_RECIPIENT TYPE REF TO IF_RECIPIENT_BCS,
    W_SENT_TO_ALL TYPE OS_BOOLEAN,
    W_OREF TYPE REF TO CX_ROOT,
    W_TEXT1 TYPE STRING,
    W_SEND_REQUEST TYPE REF TO CL_BCS,
    W_TABIX TYPE SY-TABIX.
    CONSTANTS: C_TYPE TYPE SO_OBJ_TP VALUE 'RAW',
    C_LENGTH TYPE SO_OBJ_LEN VALUE '12',
    C_X TYPE C VALUE 'X'.
    FROM = [email protected]'.
    TRY.
    create persistent send request
    W_SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).
    LOOP AT IT_TEXT INTO IS_T1.
    APPEND IS_T1 TO W_TEXT.
    CLEAR IS_T1.
    ENDLOOP.
    W_DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
    I_TYPE = C_TYPE
    I_TEXT = W_TEXT
    I_LENGTH = C_LENGTH
    I_SUBJECT = SUBJECT ).
    add document to send request
    CALL METHOD W_SEND_REQUEST->SET_DOCUMENT( W_DOCUMENT ).
    set sender
    note: this is necessary only if you want to set the sender
    different from actual user (SY-UNAME). Otherwise sender is
    set automatically with actual user.
    sender = cl_sapuser_bcs=>create( sy-uname ).
    W_SENDER = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( FROM
    CALL METHOD W_SEND_REQUEST->SET_SENDER
    EXPORTING
    I_SENDER = W_SENDER.
    add recipient (e-mail address)
    create recipient - please replace e-mail address !!!
    IF TO IS NOT INITIAL .
    W_RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS(
    TO ).
    CALL METHOD W_SEND_REQUEST->ADD_RECIPIENT
    EXPORTING
    I_RECIPIENT = W_RECIPIENT
    i_copy = c_x
    I_EXPRESS = C_X.
    W_SEND_REQUEST->SET_SEND_IMMEDIATELY( 'X' ).
    CALL METHOD W_SEND_REQUEST->SEND(
    EXPORTING
    I_WITH_ERROR_SCREEN = C_X
    RECEIVING
    RESULT = W_SENT_TO_ALL ).
    COMMIT WORK.
    ENDIF.
    CATCH CX_SY_ARITHMETIC_ERROR INTO W_OREF.
    RETURNCODE = 4.
    W_TEXT1 = W_OREF->GET_TEXT( ).
    CATCH CX_ROOT INTO W_OREF.
    RETURNCODE = 4.
    W_TEXT1 = W_OREF->GET_TEXT( ).
    ENDTRY.
    LOOP AT IT_EMAILS.
    TRY.
    CLEAR W_EMAIL.
    W_EMAIL = IT_EMAILS-RECEIVER.
    W_RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS(
    W_EMAIL ).
    IS_REC-RECIPIENT = W_RECIPIENT.
    APPEND IS_REC TO IT_REC.
    CATCH CX_ADDRESS_BCS.
    RETURNCODE = 4.
    ENDTRY.
    ENDLOOP.
    LOOP AT IT_REC INTO IS_REC.
    TRY.
    W_SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).
    W_DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
    I_TYPE = C_TYPE
    I_TEXT = W_TEXT
    I_LENGTH = C_LENGTH
    I_SUBJECT = SUBJECT ).
    add document to send request
    CALL METHOD W_SEND_REQUEST->SET_DOCUMENT( W_DOCUMENT ).
    set sender
    note: this is necessary only if you want to set the sender
    different from actual user (SY-UNAME). Otherwise sender is
    set automatically with actual user.
    sender = cl_sapuser_bcs=>create( sy-uname ).
    W_SENDER = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS(
    FROM ).
    CALL METHOD W_SEND_REQUEST->SET_SENDER
    EXPORTING
    I_SENDER = W_SENDER.
    CALL METHOD W_SEND_REQUEST->ADD_RECIPIENT
    EXPORTING
    I_RECIPIENT = IS_REC-RECIPIENT
    I_EXPRESS = C_X.
    W_SEND_REQUEST->SET_SEND_IMMEDIATELY( 'X' ).
    CALL METHOD W_SEND_REQUEST->SEND(
    EXPORTING
    I_WITH_ERROR_SCREEN = C_X
    RECEIVING
    RESULT = W_SENT_TO_ALL ).
    COMMIT WORK.
    CATCH CX_SY_ARITHMETIC_ERROR INTO W_OREF.
    RETURNCODE = 4.
    W_TEXT1 = W_OREF->GET_TEXT( ).
    CATCH CX_ROOT INTO W_OREF.
    RETURNCODE = 4.
    W_TEXT1 = W_OREF->GET_TEXT( ).
    ENDTRY.
    ENDLOOP.
    IF FLAG = 'X'.
    IF TO IS NOT INITIAL.
    IT_EMAILS-RECEIVER = TO.
    APPEND IT_EMAILS TO IT_EMAILS.
    ENDIF.
    ENDIF.
    ENDFUNCTION.
    So pls help me out asap its very Urgent.......
    Regards,
    DS

    You can fill the data into the body or attach an attachment with the email.
    For filling the data into the body, you can use the CONCATENATE statement.
    LOOP AT IT_MSEG.
    * concatenate all your fields here
      CONCATENATE IT_MSEG-MEBLNR IT_MSEG-MGJAHR INTO L_TEXT SEPARATED BY ' | '.
    APPEND L_TEXT TO IT_TEXT.
    ENDLOOP.
    Pass this IT_TEXT to your table.
    For creating an attachment you need to create a SMARTForm and than create a PDF attachment which can go alongwith the Mail.
    Regards,
    Naimesh Patel

  • How to append data from an internal table to an external table.

    HI everyone,
    I am trying to update an DB table type 'c'from the data captured in my internal table. can any one tell me as to how to do this.the contents of the DB table needs to be erased completly before i send in new data.
    Regards,
    Vj

    Assuming that you table has 1 character field(?) besides the MANDT field
    MANDT
    FIELD
    you need to update this db table with values from ITAB which I assume has one field of type c.
    To first delete all of the data from DB table.
    * Yes there are other ways of doing this.
    tables: ztable.
    select * from ztable.
    delete ztable.
    endselect.
    Then simply LOOP your internal table and update the table.
    loop at itab.
      ztable-field = itab-field.
      insert ztable.
    endloop.
    Regards,
    Rich Heilman

  • How to append data from one file to another

    Hello,
    I am trying to replace one column of numbers in a 2D array with a unique string from another file.
    Pos.    Serial    Gain
     2        3252        4
     4        15697      4
     6        15543      4
    I want to replace the "4" in the third column with a string obtained from another file, such as;
    Serial # 3252 Fuel Cell # arxe-2282
    Time and date 09:47   09/08/07
    Version 4.0
    Serial # 1234 Fuel Cell # arxf-0047
    Time and date 09:50   09/08/07
    Version 4.0
    In this case, I want to replace the "4" in the first row of the top file (after the header) with "arxe-2282" from the file just above.
    This means I need to search though the second file (which will have multiple entries) and find the same serial number (in this case "3252") and then write the "arxe-2282" string in place of the "4" in the top file, right next to the "3252" number there.
    The search part is proving difficult. I can replace the "4" easy enough, but only if I already know where the "arxe-2282" is in the second file.
    Any ideas?
    Tay

    try this.....
    the program uses the match pattern and scan from string functions.  And there is still room for improvement.
    If you have to do is more often with bigger files, you should create a lookup table first. currently the files is scanned each time ....
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'
    Attachments:
    find location.vi ‏11 KB

  • How to save data (DBL array) in a excel file

    Ok, I am new into Labview.  This question may seem easy for you guys, but for me, it is quite a challenge.  I have current coming out of a loop.  When the program stop, I would like to be able to save it as well as the time when it has been taking and the average current in a excel file.  When my labview code stops, how do I do to get a  pop up window which ask me where and what name to save it to? How do I get so that on the top of each column, it says : current (Amp)    Time (ms)   Average Current (amp)?
    thank you very much,

    Hello,
    We love to see people catch the LabVIEW spirit and anything we can do to help
    you through the initial learning process is our pleasure.
    As KC suggested saving the file as a .csv is a good idea,
    you can also save it as a txt file and open it with Excel specifying a delimiter
    for the columns.
    There is a really good example you can find in the LabVIEW
    example finder if you search for the keyword ‘file’, the example is called “Write
    to Text File.vi”. They use a Get date/time String to record the time when data
    is acquired.
    I have attached a simple Write to File picture of a VI that
    takes a random number and writes it to a file. When I run the VI, a popup asks
    me what I want to call the file. The first part writes the heathers on the
    columns and inside of the for loop I save the data. Underneath the block diagram
    is a picture of the output file when I specify the number of samples to be five.
    If you want your file to be on a very specific format, you
    can create a template file, read it in LabVIEW, and then add your data to it
    and save it to a new file.
    Hope this can get you started with your program.
    There are a lot of good tutorials online on how to
    get started using LabVIEW. Here is the link to a three hour
    introduction course:
    http://zone.ni.com/devzone/learningcenter.nsf/03f7c60f17aad210862567a90054a26c/60c2782788a811c986256cd50001a0a6?OpenDocument&node=200067_us
    We are also comming out with LabVIEW 8 in November and we have a program called LabVIEW Standard Service Program
    (SSP) that allows you to get automatic upgrades and updates. Please let
    me know if you are interested in knowing more about it.
    Good luck,
    Tica Taveras
    Applications Engineer
    National Instruments
    Attachments:
    SaveData.bmp ‏1475 KB

  • How to append datas to a text file?

    Hi,
    I want to append the data to a already created text file.When i used Write to text file.vi. It overwrites the previous data.
    Solved!
    Go to Solution.

    Try using the 'set file position' function (file io palette, advanced functions)  before you write the data.
    i.e. open the file, set position to end, write the data, close the file.
    Ian

  • Need help with how to store data in array in from reading file

    i have a file named xxx.txt
    i need to retreive data from that file. the data that i want to retrieve is enclosed with << >>
    temp xxx-123 ccc << 90.5>>
    haha xxx-563 sss 85.2
    after a few lines, the another record appear.
    temp2 xxx-123 ccc << 190.5>>
    haha2 xxx-563 sss 885.2
    i would like to record down the data, 90.5 & 190.5, how do i go about doing so, will appreciated it if someone would guide me along. thanks

    After you have read a line from the file either
    find the location of << and >> and substring the stuff in between or
    use regex (regular expression) however this is advanced and may be beyond your level of understanding.

Maybe you are looking for