Extraction elements from vector

   Hi everybody, 
 Can anybody help with this problem, pls  Im a begginer with labview  I would like solve a problem: There is  matrix (2048x1 elements) and I would draw it point by point in wafeform chart, I have already tried everything,  but I have  allways drawn the whole vector.
 Sorry for so stupid question......
   best regards
thx  tomas

Not stupid, but it is resolved.
http://forums.ni.com/t5/LabVIEW/Graph-an-Array-but​-not-every-row-of-it/td-p/1188601
Mahu

Similar Messages

  • How to extract data from vector?

    the following code returns vector as report which it recieves from TempSave.
    public Vector getQueryReport() throws ApplicationException, NoServiceException, CheckException
         Vector report =null;
         report =TempSave.getReportCE01();
         return report;
    }TempSave.java
    public class TempSave
       public static Vector getReportCE01()
       Vector dataSet = new Vector();
       dataSet.add(new SimplePOJO( "     B0210     ","     B.2)Acquisti di servizi     ","     6202254319     "));
       dataSet.add(new SimplePOJO( "     B0220     ","         B.2.1) per medicina di base     ","     582877602     "));
        return dataSet;
    } SimplePOJO is class which stores the passed value as in following function
    public SimplePOJO(String cOD_MOD, String dESC_MOD, String amt)
              this.COD_MOD = cOD_MOD;
              this.DESC_MOD = dESC_MOD;
              this.AMT = amt;
           }what i need is the last element "amt" ,saved as 6202254319,...,...     etc . Now i want to extract it from vector in getQueryReport(). So how can i do that?

    Try this:
    public Vector getQueryReport() throws ApplicationException, NoServiceException, CheckException
         Vector report =null;
         report =TempSave.getReportCE01();
         for(int i=0; i<report.size();i++)
                SimplePOJO pojo=(SimplePOJO)report.get(i);
                String amt=pojo.AMT; // if AMT in SimplePOJO is declared public  
         return report;
    }Hope this helps.

  • Extracting elements from an xml string - org.apache.xerces.dom.DeferredText

    Hello all,
    I am new to xml, and I thought I had a handle on things until I got this problem...I am getting an xml string from the body of an e-mail message, and then I am trying to extract elements out of it. Here is an example xml string:
    <?xml version="1.0" encoding="UTF-8"?>
    <filterRoot>
       <filter action="MOVE" bool="AND" name="My Saved Filter" target="Deleted Items">
          <condition attribute="TO" bool="AND" contains="CONTAINS">
             <value>[email protected]</value>
             <value>[email protected]</value>
             <value>[email protected]</value>
             <value>[email protected]</value>
             <value>[email protected]</value>
          </condition>
       </filter>
    </filterRoot>I am trying to extract the <filter> element out and store it into a Vector of Elements (called, not surprisingly, filters). However, I am getting a class cast exception:
    java.lang.ClassCastException: org.apache.xerces.dom.DeferredTextImplIt is being called from where I trying to extract the <filter> in this way:
            filterRoot = doc.getDocumentElement(); // get topmost element
            NodeList list = filterRoot.getChildNodes();
            Vector newFilters = new Vector();
            debug("There are "+list.getLength()+" filters in document");
            for(int i=0; i<list.getLength(); i++) {
                Node n = list.item(i);
                debug("Node "+i+" getNodeValue() is "+n.getNodeValue());
                Element temp = (Element)n;
                newFilters.add(temp);
            }Perhaps my question is, how do I correctly get hold of the <filter> node so that I may cast it as an Element?
    thanks,
    Riz

    Yes, I already knew that it is not a bug.
    But, I got next step problem.
    I put "false" to "include-ignorable-whitespace" feature in xerces parser.
    But, I still found unnecessary TextNodes in my parser object.
    Feature link : http://xerces.apache.org/xerces-j/features.html.
    I use xerces-2_8_0.
    DOMParser parser = new DOMParser();
    parser.setFeature("http://apache.org/xml/features/dom/include-ignorable-whitespace", false);
    parser.parse(inputSource);
    document = ps.getDocument();
    System.out.println(document.getDocumentElement().getChildNodes().length()); // still wrong lengthIs tehre any example of usage this feature?
    What is default defination of white-space "\n "(enter with one space) or " "(juz white space) or something else?
    Thanks,

  • How do I extract elements from a file?

    Let's say I have a larger file with several layers and various elements on the layers - like a web page layout.
    On 1 layer the is top logo.
    I am trying to extract just that 1 part and save for web as small jpg or png and put that one pic in my web design app.
    Q: How do I easily exctract / export / save for web (small version) just that one part?

    If you do a lot of saving graphic elements from web page mock-ups, it's worth reading up on using slices.
    Also have a look at layer comps. Combining the two enables you to save all the graphic elements of the web page (including various roll-over states) from one master file.

  • Removing element from vector

    I am trying to remove an element from a Vector and using the ff code:
    Vector abc = getVector();
    int index = 0;
    abc.removeElementAt(index);
    The element is not being removed, when i go back to check the number
    of elements in the vector, it is still the same.
    Please give me any ideas to make this work.

    Try this,
    Vector abc = getVector();
    int index = 0;
    System.out.println("Size before : "+abc.size());
    abc.remove(index);
    System.out.println("Size after : "+abc.size());
    What is the o/p?
    Sudha

  • Extract element from PDF document from automatized process

    Hi
    I have never worked on PDF document and I am looking a solution for :
    extracting elements (simply text in a first time) in a PDF document in paragraph and/or in table
    after this I could manipulated them in another processing
    Have you any idea or information about my need (what should be the best way for doing this ?)
    SDK package : possible for doing this, if yes : which one ?
    another solution than SDK package
    PDF version supported : latest ones ?
    any advice about best developpement language : java (I prefer), or other ?
    Thanks for all you advices !!!
    Lst

    Well, if you want Java - then Adobe only has server-side options for you. We don't offer desktop Java APIs.  Our server-side options are part of the Adobe LiveCycle family of products.
    For client-side, we have the Adobe Acrobat SDK (which also requires Adobe Acrobat to be installed) or the PDFLibrary SDK (for stand-alone applications).  Both are C/C++ based.

  • How to extract elements from a document

    I'm new to Java and I'm using JDOM in a JSP page. I've a document like this:
    <OFFERTA>
    <FACOLTA idFacolta="F1">
    <CORSO value="xxx"/>
    <CORSO value="yyy"/>
    </FACOLTA>
    <FACOLTA idFacolta="F2">
    <CORSO value="zzz"/>
    </FACOLTA>
    <FACOLTA idFacolta="F3">
    </FACOLTA>
    <FACOLTA idFacolta="F4">
    </FACOLTA>
    </OFFERTA>
    I'd like to get a document with the same structure but with the only FACOLTA elements that match a requested value for the idFacolta attribute.
    For example, if the requested idFacolta is "F2", I'd like to get:
    <OFFERTA>
    <FACOLTA idFacolta="F2">
    <CORSO value="zzz"/>
    </FACOLTA>
    </OFFERTA>
    I check in a loop if the element matches the idFacolta requested but when I find and try to delete it I get:
    java.util.ConcurrentModificationException
         at org.jdom.ContentList$FilterListIterator.checkConcurrentModification(ContentList.java:1230)
         at org.jdom.ContentList$FilterListIterator.hasNext(ContentList.java:942)
    Here's my code:
    Document doc = builder.build(file);
    Element root = doc.getRootElement();
    List children = root.getChildren();
    Iterator facoltaIterator = children.iterator();
    // Check if there's a request
    if (id!=null) {
         while (facoltaIterator.hasNext()) {
              Element facolta = (Element) facoltaIterator.next();
              if (!facolta.getAttribute("idFacolta").getValue().equalsIgnoreCase(id)) {
                   // Delete
                   root.removeContent(facolta);
    All seems to be right, except the line
    root.removeContent(facolta);
    So, I tried to make a new document for the results, adding the element facolta:
    Document doc = builder.build(file);
    Element root = doc.getRootElement();
    // Create a new document with the same root
    Element rootRisultati = new Element("OFFERTA");
    Document docRisultati = new Document(rootRisultati);
    List children = root.getChildren();
    Iterator facoltaIterator = children.iterator();
    if (id!=null) {
         while (facoltaIterator.hasNext()) {
              Element facolta = (Element) facoltaIterator.next();
              if (facolta.getAttribute("idFacolta").getValue().equalsIgnoreCase(id)) {
                   // Add the element to the new document
                   rootRisultati.addContent(facolta);
    but this causes a different exception:
    org.jdom.IllegalAddException: The element already has an existing parent "OFFERTA"
         at org.jdom.ContentList.add(ContentList.java:190)
         at org.jdom.ContentList.add(ContentList.java:146)
         at java.util.AbstractList.add(AbstractList.java:84)
         at org.jdom.Element.addContent(Element.java:1062)
    I'm not able to find a solution.
    There's a commonly used procedure to select elements maintaing the structure of the document?
    Can anyone help please? Thanks in advance.
    Stefano

    maybe you could try posting this in a JDOM forum? JDOM is not a standard XML tool from Sun / for Java... therefore out of the scope of this forum!

  • How to extract elements from an HTML page?

    Hi:
    If we have the following returned page which is the web query result from a library: http://library.fsi.uiuc.edu/dbtw-wpd/exec/dbtwpub.dll?XC=%2Fdbtw-wpd%2Fexec%2Fdbtwpub.dll&BU=http%3A%2F%2Flibrary.fsi.uiuc.edu%2Fdbtw-wpd%2FnewWeb%2Fauthor.asp&submit=Submit+Query&QB0=AND&QF0=Author&QI0=william&QB1=AND&QF1=Corporate+Author&QI1=&MR=20&TN=Catalog&DF=Display-Web&RF=Brief+Title+-+Web&DL=1&RL=1&NP=1&AC=QBE_QUERY
    If we want to store all the returned information in the local memory,
    how can Java be used to extract the records out of the html page?
    What kind of classes should be used?
    For example, should I just use regular expression to do this (java.util.regex class),
    build-in html parser (javax.swing.text.html.parser.Parser, or even javax.swing.text.html.HTMLEditorKit.Parser), or any other classes? Thanks.

    I been working on a simular project but i might not be using a method that you would want.
    I am reading the webpage code and then getting the data by looking for certain words. The problem with this is that it is reading the page "blindly" so it could read the wrong data or screw up on an error on the page. but here is a bit of code i am using. I am using ti to get data that appears in " " (quotes) so i can get urls, images, etc
    This code isnt totaly mine, i amended it from some one and dont know the original owner :(
    try {
            is =                    new BufferedInputStream(new URL(jTextField1.getText()).openStream());
          while ((record = is.read()) != -1) {
            buffer.append((char) record);
            length++;
            System.out.print((char)record);
          }     is.close();
    } catch // error management herei am using a seperate thread running at same time to enter data
    do {
            while (lengthposition != length) {
              //System.out.print(buffer.charAt(lengthposition));
              temp[0] = "" + buffer.charAt(lengthposition);
              if (buffer.charAt(lengthposition) != /*34*/64 && tolist == true)
                temp[1] += ""+ buffer.charAt(lengthposition);
              else if (buffer.charAt(lengthposition) == /*34*/64 && tolist == false)
                tolist = true;
              else if (buffer.charAt(lengthposition) == /*34*/64 && tolist == true) {
                tolist = false;
                list1.addItem(temp[1]);
                temp[1] = "";
              lengthposition++;
          } while (buffer.charAt(lengthposition) != 32);I hope you find out a solution to your problem :)

  • If I'm copying text and/or vector elements from Indesign to Photoshop how come their pixel sizes change even though I opened the same sized document and my indesign file is a web file?

    If I'm copying text and/or vector elements from Indesign to Photoshop how come their pixel sizes change even though I opened the same sized document and my indesign file is a web file?

    >my indesign file is a web file
    Pardon?
    Or do you mean that, when you created a new document, you choose Web as intent maybe?

  • Kill a thread and remove the element from the vector

    Hi All
    I have attached each Vector element to a thread which I later want to kill and remove that element from the Vector.
    Thread.join(milliseconds) allows this functionality to let the thread die after n milliseconds.
    However, I want to delete this element from the Vector now.
    Can someone please throw some light on this?
    Here the code I have written for this:
    try
         System.out.println(counter);
         int xCoord = generator.irand(25,200);     // X-coord of AP
         int yCoord = generator.irand(25,200);     // Y coord of AP
         listMN.addElement(new MobileNode((int)mnId,new Point2D.Double(xCoord,yCoord)));
         listMNcoords.addElement(new Point2D.Double(xCoord,yCoord));
         for(int i=0;i<vnuBS.returnBSList().size();i++)
              if(vnuBS.returnBSListCoords().get(i).contains(xCoord,yCoord)&&(vnuBS.returnBSList().get(i).getChannelCounter()<=3)&&(vnuBS.returnBSList().get(i).getChannelCounter()>0))
                   double c = exponential() * 10000;
                   long timeToService = (long)c;
                   System.out.println("BS "+vnuBS.returnBSList().get(i).id+" is connected to MN ");
                   vnuBS.returnBSList().get(i).reduceChannelCounter();
                   System.out.println("Channel Counter Value Now: "+vnuBS.returnBSList().get(i).getChannelCounter());
                   mobileNodesThread.addElement(new Thread(listMN.elementAt(mobileNodeCounter)));
                   mobileNodesThread.elementAt(mobileNodeCounter).setName(mobileNodeCounter+"");
                   mobileNodesThread.elementAt(mobileNodeCounter).start();
                   mobileNodesThread.elementAt(mobileNodeCounter).join(100);
    //                              System.out.println("Died");// thread dies after join(t) milliseconds.
                   System.out.println("ListMN getting generated : " + mobileNodesThread.get(mobileNodeCounter));
              else if(vnuBS.returnBSListCoords().get(i).contains(xCoord,yCoord)&&(vnuBS.returnBSList().get(i).getChannelCounter()<=0))
                   listMN.remove(this.listMN.lastElement());                         //dropcall
                   System.out.println("Removed "+mnId);
                   removeCounter++;
                   mnId = mnId--;
                   mobileNodeCounter--;
              mnId = mnId+1;
         Thanks a lot.

    I'm not sure if what you are trying to accomplish is correctly implemented.
    The method join does not kill the thread. It will wait for the specified time for the thread to exit. If you want the thread to run for a specified ammount of time, develop the run method of that thread with that in mind. Do not try to kill it from the outside, but let it terminate itself (gracefull termination).
    Now for your question regarding the vector (you should probably be using ArrayList nowadays): I would implement the observer pattern for this job. Make the threads post an event on the interface when they are done, let the main thread register itself with the threads and synchronize the method that handles the events. In that method you can remove the object from your list.
    I'm not sure if you want to use thread anyhow, could you tell us what it is that you are trying to accomplish?

  • Is there a way to select a certain box of elements from a csv file and read that into LabVIEW?

    Hello all, I was wondering if there was a way to select only a certain "box" of elements from a .csv file in LabVIEW? I have LabVIEW 2011 and my main goal is to take two arrays and graph them against each other. I can import the .csv file just fine and separate each row and each column to be its own, but say I have an 8X8 but want to graph the middle 4X5 or something like that. Is there any way to extract an array without starting at the beginning and without ending at the end? Thank you in advance.
    Solved!
    Go to Solution.

    Hi Szklanam,
    as a CSV file is just a TXT file with a different suffix you can read a certain number of lines of that file. So you can limit the number of rows in your resultung array. To limit the number of columns you still have to use ArraySubset, so maybe it's a lot easier to read the full CSV file and pick the interesting spots with ArraySubset...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to extract data from a file?

    o to all labview users.
    I am currently learning labview to control the network analyzer hp8720
    as part of my project. Through my program, i am able to do a sweeping
    function with my NA and the sweeping data are written to txt file. and
    i want to extract the db value corresponding to a specific frequency.
    my txt file is like the following:
    MHz   dB
    103     0.015
    168     2.09
    201     2.67e01
    I know that we can extract certain selected data by using the some palettes like "read file" and "scan file"
    I tried using "scan file" and i couldnt extract the data(ex: the dB
    value corresponding to 168MHz) i want successfully....i checked the
    help file and did put some syntax in the format string like (%[^2.09]),
    but it seems the "scan file" palette was only able to scan the first
    line, which gave me "Mhz db".....
    is the format of my txt file not correct?
    also, i tried using "read file" palettle..and i set the count to "-1"
    to read the whole file. someone suggested on the forum that it is
    easier to read the whole file and then use array to extract the
    selected data.
    How can i write to the array using "read file" while specifying the what range of data i want?
    Instead of doing that, maybe i can just simply write the db value
    related to the specific range of frequency while the program is in a
    while loop doing sweeping?
    It would be greatly appreciated if someone could me some guidance.
    thank you very much
    Happy guy
    ~ currently final year undergraduate in Electrical Engr. Graduating soon! Yes!
    ~ currently looking for jobs : any position related to engineering, labview, programming, tech support would be great.
    ~ humber learner of LabVIEW lvl: beginner-intermediate

    Hi, I have been reading this post It is very interesting and also I
    need help. I am doing a project involving scattering matrix (S
    parameter) using frequency and time domain analysis. In order to make
    use of S parameter in frequency domain from Vector Network Analyzer, I
    need to convert S parameters from frequency domain (sweep from 8.2 GHz
    to 12.4 GHz) to time domain using inverse chirp z transform or any. I
    have no idea how to implement it. Could you please help or guide me how
    to implement them. I am using Labview 8.0 and matlab. Please see the attached file for the data in frequency domain both linear , dB magnitude and phase.
    Thank you so much for any help.
    Tantong
    Attachments:
    S11 Phase.xls ‏70 KB
    S11 dB magnitude.xls ‏70 KB
    S11 linear magnitude.xls ‏70 KB

  • How to extract data from planning book

    nu t apo. need help regarding how to extract data from planning book givn the planning book name , view name & some key figures.
    Total Demand (Key Figure DMDTO):
    o     Forecast
    o     Sales Order
    o     Distribution Demand (Planned)
    o     Distribution Demand (Confirmed)
    o     Distribution Demand (TLB-Confirmed)
    o     Dependent Demand
    Total Receipts (Key Figure RECTO):
    o     Distribution Receipt (Planned)
    o     Distribution Receipt (Confirmed)
    o     Distribution Receipt (TLB-Confirmed)
    o     In-Transit
    o     Production (Planned)
    o     Production (Confirmed)
    o     Manufacture of Co-Products
    Stock on Hand (Key Figure STOCK):
    o     Stock on Hand (Excluding Blocked stock)
    o     Stock on Hand (Including Blocked stock)
    In-Transit Inventory (Cross-company stock transfers)
    Work-in-progress (Planned orders / Process orders with start date in one period and finish date in another period)
    Production (Planned), Production (Confirmed) and Distribution Receipt elements need to be converted based on Goods Receipt date for projected inventory calculation.

    Hello Debadrita,
    Function Module BAPI_PBSRVAPS_GETDETAIL2 or BAPI_PBSRVAPS_GETDETAIL can help you.
    For BAPI BAPI_PBSRVAPS_GETDETAIL, the parameters are:
    1) PLANNINGBOOK - the name of your planning book
    2) DATA_VIEW - name of your data view
    3) KEY_FIGURE_SELECTION - list of key figures you want to read
    4)  SELECTION - selection parameters which describe the attributes of the data you want to read (e.g. the category or brand). This is basically a list of characteristics and characteristic values.
    BAPI_PBSRVAPS_GETDETAIL2 is very similar to BAPI_PBSRVAPS_GETDETAI but is only available from SCM 4.1 onwards.
    For the complete list of parameters, you can go to transaction SE37, enter the function module names above and check out the documentation.
    Please post again if you have questions.
    Hope this helps.

  • Error while extracting values from SOAP Body using XPath (Retrieve from Message filter)

    Hi,
    I am using 'Retrieve from Message' filter to extract element value from the following SOAP response envelope:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:math="http://example.com/math.xsd">
    <soapenv:Header/>
    <soapenv:Body>
    <math:DivideResponse>
    <iResult>10</iResult>
    </math:DivideResponse>
    </soapenv:Body>
    </soapenv:Envelope>
    I am using the XPath expression - /soapenv:Envelope/soapenv:Body/math:AddResponse/iResult
    soapenv = http://example.com/math.xsd
    math = http://schemas.xmlsoap.org/soap/envelope/
    ERROR
    4/19/15, 19:29:03.016
    Empty attribute retrieved from message via XPath
    ERROR
    4/19/15, 19:29:03.016
    The message [Id-59643455b76a00000000000045edd6a6] logged Failure at 04.19.2015 19:29:03,015 with log description: Failed to extract attributes via XPath
    ERROR
    4/19/15, 19:29:03.017
    Retrieve math result from SOAP response
    Could you please help me resolve it?
    Thanks,
    Aneesh.

    Hi Aneesh,
    XPath Expression: /soapenv:Envelope/soapenv:Body/math:DivideResponse/iResult
    You are using AddResponse in your XPath there is no element named like that.
    Cheers,
    Stefan

  • Using Assembler to extract links from a file contained in a package

    Hi everyone,
    I need help creating a DDX file that would extract links from the second file in a package. Can you point me to some examples somewhere? The file has links to other files in the package. It doesn`t work when I remove it from the package, the links seem to be broken, so I can`t extract them. I've tried a lot of ways with PackageFiles nameKeys but I always get the Cover page links for some reason. We need to extract the links to view what they need to look like.  Ultimately, I need to replace URL links with links to files in a package.  In the solution, I will extract URL links, replace them with GOTOE actions in the .xfdf file and reinsert the links in that PDF that's being packaged.  It will point directly to files in the package as oppose to web locations.  I plan to apply an XSLT transformation as a step in the process.
    Thanks,
    Alain Roy

    You mentioned that The file has links to other files in the package. How did those links get there? Were those links originally between PDF files in a relative folder structure? Then you put those PDF files into the PDF package?
    Unfortunately, Acrobat 9 does not support hypertext linking between files in a PDF package.
    You mentioned your lack of success getting the links from the second file in the PDF package. In your PackageFiles result element, you can specify the name of the file you want, but you cannot specify the ordinal number of the file.  Here is a DDX that extracts a file from a package. The <NoPackage> changes the result from a PDF package to a single PDF.
    <DDX xmlns="http://ns.adobe.com/DDX/1.0/">
    <PDF result="myresult">
    <NoPackage/>
        <PackageFiles  nameKeys="Recap.pdf">
            <PDF source="doc1"/>
        </PackageFiles>
    </PDF>
    </DDX>

Maybe you are looking for

  • To replace defective goods free of cost if it is brought back

    Hi all can any one suggest me how to go about this scenario how to replace defective goods free of cost if it is brought back within 6 months of the invoice date. what is the process thanks in advance sri

  • Extreme + Shared Disk through a NAT?

    Hi, I've done a search on this topic but can't find a thread that answers my question - so I beg forgiveness if this has been asked and answered many times... I've got an Extreme base station hosting a shared disk for a small business LAN. It works g

  • How to change work repository internal ID

    Is it possible to change the ID of existing work repository. Or a new work repository has to be created to get a new different ID.

  • The new iTunes format is horrible

    What happened to iTunes? There are so many stupid animations and sub-windows, it takes forever to load the iTunes Store page. The new format to preview songs is horrible too as is the Power Search result window. After doing a Power Search for a Title

  • ADF BC : setNamedWhereClauseParam() on detail ViewObject

    hi Using JDeveloper 10.1.3.0.4, I have some trouble setting a named where clause parameter on a "detail" ViewObject. I have an ApplicationModule (DetailSubsetService) with two instances of the same ViewObject (EmpsInMonth) that has a bind variable (v