A rather complicated task of string

Hello guys!

Today I had a bit of a mess when doing a program for my company. I'm reading from a .csv file that is containing information on electrical components. I read the cell in a table for later use. No problem at all.

Now the hardest part:

Let's say a cell in the .csv file contains this: C1 - C10

I put in a table and still have: C1 - C10

(C1 - C10 means that there are actually ten cmponents; C1, C2, C3... C10)

Now, I want to convert the array containing C1 - C10 in a table that looks like this:








(Fixing LV2010 of course)

I believe that a solution is to remove the C of the chain and then look at the numbers and how there are components. Put up with a C front, then create ten numbers incrementing like this:

C1 - C10-online 1-10 = ten items-online Create numbers: 1,2,3,4,5,6,7,8,9,10-online C add in front of the numbers.

in any case this algorithm must be capable of any letters and numbers, i.e. R2 - R5, K2 - K7 etc...

Anyone who did a similar thing and maybe can help me in the right direction on where to start?


Here is my attempt.  I split the string to the '-' Match jacquard can search each substring for the main letters.  Use the digital pieces to create an array of integers and convert to strings.


Tags: NI Software

Similar Questions

  • Saving a file he scores for re-compilation


    the following scenario: in CVI2013, open a project, change the source code, build and run the project and then quit the executable that you are back in the IDE. Click the green triangle again and the executable will be implemented "immediately". Now save the file and press the green triangle - ICB begins compiling and building the project.

    I don't think that's necessary, leaving little room for improvement

    It uses the temporary file while you have unsaved changes. At the time you save the file, the temporary file is discarded and the regular file is used instead.

    Manage these temporary files is a rather complicated task, in which regard the precompiled header files, navigation, the source code include paths and many other things. In view of this, keep indefinitely around is unfortunately not an option. Dealing with this complexity was necessary given that the CVI has previously been able to compile the unsaved files and should continue to do so. But it is somewhat unusual and generally is not allowed by ADEs traditional. So, another way that you have to avoid this problem is to transform a more traditional compiler by enabling the option 'Save changes before compiling' CVI. Having this option enabled may not be as convenient at times, but at least in the scenario that you described above, it would have been only a generation instead of two.

    Moreover, the painfully slow compilation is not acceptable for us, and it will be addressed. Besides, I also don't think it's typical, but of course, it's probably not much consolation for you right now.

  • Permission to create/run the scheduled task


    I'm running Windows 7 Pro RTM and I try to use my normal user account to create and run a new scheduled task, but whenever I try to save the task, I get an error msg saying "Task Scheduler cannot create the task.» Does not know the user account, the password is incorrect or the user account doesn't have permission to create this task".

    I have no problems running tasks under my admin account, but I don't want to use it for everyday purposes. I'm also sure that this error must be because of permissions problems, so can I know what is the privilege that a user must have to create/run one account task?

    Thank you very much

    Hi hifer,.

    Please use the forum for answers,

    If your account is a standard account, you will not have permission to create a task or schedule task.  Your account must be an administrator account to schedule the task for the system or it must be run as an administrator.

    It have additional permissions, you can add standard user profile to allow the profile to create the task.  But this option is not available in all versions of Windows and rather complicated.  You can try to add these groups to your profile using computer management in administrative tools.  User with power and Backup administrator can provide you with the authorization that you need if the groups are available with your version of Windows 7.

    Hope this helps,

    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to wire a switch terminal case and depending on this value string value, run a case selected?

    Hello world

    In the schema-block sent VI, through serial comm, #2 byte is 00 or 01 (Hex). This byte must dictate which cases to run. If value = 00 Hex running case #1, Hex if value = 01 runs the #2 case. If none of the two, nothing should run.

    How can I do this? I'm relatively new to LabVIEW, any comment is appreciated.

    Thank you


    easiest of all wiring in the whole structure of the case rather than convert to string.

    Then just back up the case selector and type what you want.

  • How to create an XML Document and convert it into a string? (send through wireless network)


    I am now able to post data to a web server by using Blackberry JDE (medical use).

    Now, instead of display the plain text, I would like to send an XML file.

    I am able to do it using this code on a 'normal ': Java application

    import java. IO;
    Org.w3c.dom import. *;
    Import javax.xml.parsers. *;
    Javax.xml.transform import. *;
    Javax.xml.transform.dom import. *;
    Javax.xml.transform.stream import. *;

    public class {XML
    Public Shared Sub main (String [] args) {}
    try {}
    DocumentBuilderFactory plant = DocumentBuilderFactory.newInstance ();
    DocumentBuilder builder = factory.newDocumentBuilder ();
    Doc document = builder.newDocument ();
    Root element = doc.createElement ("root");
    doc.appendChild (root);
    Child element = doc.createElement ("child");
    child.setAttribute ("name", "value");
    root.appendChild (child);

    Add a text element to the child
    Text = doc.createTextNode ("text");
    child.appendChild (text);

    implement a transformer
    TRANSFAC TransformerFactory = TransformerFactory.newInstance ();
    Transformer trans = transfac.newTransformer ();
    trans.setOutputProperty (OutputKeys.OMIT_XML_DECLARATION, 'yes');
    trans.setOutputProperty (OutputKeys.INDENT, 'yes');

    create the string of the xml tree
    StringWriter sw = new StringWriter();
    StreamResult result = new StreamResult (sw);
    DOMSource source = new DOMSource (doc);
    TRANS. Transform (source, result);
    String xmlString = sw.toString ();
    System.out.println (xmlString);
    } catch (Exception e) {}
    make error management

    However, on the Blackberry JDE, many functions is not recognized.

    I saw the class DocumentBuilderFactory (net.rim.device.api.xml.parsers.DocumentBuilderFactory), the DocumentBuilder (net.rim.device.api.xml.parsers.DocumentBuilder) class and the interface of Document in the docs of Blackberry Java (4.2.1).

    So, I'm able to create an XML Document... but I don't know how to convert to a string?

    How can I do this? The TransformerFactory class doesn't seem to exist... and I did not find an alternative yet.

    At the present time, here is the code I use to publish data:

    String coord = lat + ";" + LNG; post data
    con = (HttpConnection) Connector.open (url); Open the connection URL
    con.setRequestMethod (HttpConnection.POST); POST method
    con.setRequestProperty ("Content-Type", "application/x-www-formulaires-urlencoded");
    out = con.openOutputStream (); display the results in a stream
    out. Write (Coord.GetBytes ());

    responseCode = con.getResponseCode (); Send data and receive the response code
    If (responseCode! = HttpConnection.HTTP_OK) {}
    System.out.println ("HTTP STATUS CODE: 404"); error
    } else {}
    System.out.println ("HTTP STATUS CODE: 200"); successful
    If (con! = null) con. Close; close the connection to the URL

    As mentioned, rather than display a string with a delimiter between each value (there will be a lot more than two values finally), I would like to publish an XML.  It will be more "elegant" and easier to parse by my code on the web server.

    Maybe I don't have to convert it to a string?

    In other words, how can I convert my XML Document to send it via the wireless network?

    Thanks for your help!

    TransformerFactory does not exist in the BlackBerry API.  As far as I can tell, you need to implement yourself.  You can do this by walking the DOM and the output of channels.  They have an example of the market of the DOM in the XMLDemo, but they view as fields, you just need to write strings.

  • When the FAILURE of the Worker.State occurs in a task?

    How detect that a Worker.State has no PU occurs in a task? or say when the FAILURE of the Worker.State occurs in a task? It's when an exception occurs in the task call() method?

    Consider the code below:

    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.net.URI;
    import java.net.URISyntaxException;
    import java.net.URL;
    import java.net.URLConnection;
    import javafx.concurrent.Task;
     * Background task to fetch the all classes documentation page from a URL
    public class FetchDocListTask extends Task<String> {
      private final String docsDirUrl;
      public FetchDocListTask(String docsDirUrl) {
      this.docsDirUrl = docsDirUrl;
      protected String call() throws Exception {
      System.out.println("---- FetchDocListTask  docsUrl = " + docsDirUrl);
      StringBuilder builder = new StringBuilder();
      try {
      URI uri = new URI(docsDirUrl + "allclasses-frame.html");
      URL url = uri.toURL();
      URLConnection urlConnection = url.openConnection();
      urlConnection.setConnectTimeout(5000); // set timeout to 5 secs
      InputStream in = urlConnection.getInputStream();
      BufferedReader reader = new BufferedReader(
      new InputStreamReader(in));
      String line;
      while ((line = reader.readLine()) != null) {
      } catch (URISyntaxException e) {
      return builder.toString();

    When the State.FAILED occurs? In fact, I want to write a code to detect everything simply if the computer is connected to the internet. Hope to help ~

    Yes. If the call() method stops due to an unhandled exception, the condition of the property becomes IMPOSSIBLE. If a return statement is executed successfully, the ownership of the State passes to SUCCEEDED. There are no other possibilities.

    You can test it with something like:

    import javafx.application.Application;
        import javafx.concurrent.Task;
        import javafx.concurrent.WorkerStateEvent;
        import javafx.event.EventHandler;
        import javafx.scene.Scene;
        import javafx.scene.control.TextArea;
        import javafx.scene.layout.BorderPane;
        import javafx.stage.Stage;
        public class TaskStateTest extends Application {
            public static void main(String[] args) { launch(args); }
            public void start(final Stage primaryStage) {
                Task exceptionHandlingTask = new Task() {
                    protected Void call() throws Exception {
                        try {
                            throw new Exception("Boom");
                        } catch (Exception exc) {
                            System.out.println(exc.getMessage() + " handled");
                        return null;
                Task exceptionThrowingTask = new Task() {
                    protected Void call() throws Exception {
                        throw new Exception("Boom");
            //            return null;
                final BorderPane root = new BorderPane();
                final TextArea textArea = new TextArea();
                primaryStage.setScene(new Scene(root, 600, 400));
                registerHandlers(exceptionHandlingTask, "exceptionHandlingTask", textArea);
                registerHandlers(exceptionThrowingTask, "exceptionThrowingTask", textArea);
                Thread t1 = new Thread(exceptionHandlingTask);
                Thread t2 = new Thread(exceptionThrowingTask);
            private void registerHandlers(final Task task, final String msg, final TextArea textArea) {
                task.setOnFailed(new EventHandler() {
                    public void handle(WorkerStateEvent event) {
                        textArea.appendText(msg + " failed\n");
                task.setOnSucceeded(new EventHandler() {
                    public void handle(WorkerStateEvent event) {
                        textArea.appendText(msg +  " succeeded\n");
  • How to access human management task using TaskQueryService?


    I want to access human task payload programmaticall attributes from a java application customized using TaskQueryService.
    Could you please share some snippet on how to do it?
    I have a task of string parameter named param1 which I want to access.

    Kind regards


    Take a look at this post: http://beatechnologies.wordpress.com/2011/08/24/

    Also here is the Oracle Doc: http://docs.oracle.com/cd/E12839_01/apirefs.1111/e10660/oracle/bpel/services/workflow/query/ITaskQueryService.html



    I hope this helps.
    The best

  • How can I convert string to xml in CEP

    I made a simple CEP process that reads from a queue. The CEP has the following components:
    1 input adapter named MktEvtInputadapter.
    2 channel MktEvntInchannel
    3. a MktEvntProcessorprocessor processor.
    4. a MktEvntOutChannel output.
    5. a MarketEventBean bean.

    code for MarketEvent.java:
    package com.bea.wlevs.example.algotrading.event;

    public class MarketEvent {}

    Private Sub Long;
    symbol of the private channel;
    price Double private;
    volume of Long private;
    private Long latencyTimestamp;
    private string text;

    * @return the latencyTimestamp
    {} public Long getLatencyTimestamp()
    Return latencyTimestamp;
    @param latencyTimestamp the latencyTimestamp to
    {} public void setLatencyTimestamp (Long latencyTimestamp)
    this.latencyTimestamp = latencyTimestamp;
    * the timestamp @return
    {} public Long geteventTimeStamp()
    return Sub;
    @param timestamp the timestamp to set
    {} public void seteventTimeStamp (Long Sub)
    this.eventTimeStamp = Sub;
    * @return the symbol
    public String getSymbol() {}
    return the symbol;
    @param symbol the symbol to define
    {} public void setSymbol (symbol of the chain)
    This.Symbol = symbol;
    * @return the price
    {} public Double getPrice()
    return of the price;
    @param price TBD
    {} public void setPrice (Double rate)
    This.Price = price;
    * @return the volume
    {} public Long getVolume()
    return of volume;
    @param volume the volume to set
    {} public void setVolume (Long volume)
    This.volume = volume;
    public void setString_1 (String text) {}
    This.Text = text;
    TODO self-generating method stub

    public String getString_1() {}
    TODO self-generating method stub
    return (text);


    Code for MarketEventBean:
    package com.bea.wlevs.example.algotrading;

    import com.bea.wlevs.ede.api.StreamSink;
    import com.bea.wlevs.example.algotrading.event.MarketEvent;

    / public class MarketEventBean implements StreamSink {}
    {} public void onInsertEvent (event object)
    If (event instanceof MarketEvent) {}
    MarketEvent marketEvent = (MarketEvent) event;

    System.out.println ("msg:" + marketEvent.getString_1 ());


    I put an xml doc in my queue for entry:
    <? XML version = "1.0" encoding = "UTF-8"? >
    < MarketEvent >
    < sub > 201100501 < / sub >
    < symbol > ABCD < / symbol >
    < price > 258474.56 < / price >
    < volume > 4657892 < / volume >
    < latencyTimestamp > 201100501 < / latencyTimestamp >
    < / MarketEvent >

    My class MarketEventBean will print the msg as string. Now, I have to convert it to xml format to get the value of individual items.
    How can I do?

    I think you need to do this:

    Events.Add (obj);

    in this way, you add the event unmarshaled flow rather than just a string of text

  • Assign the role, the Group initiated human when task

    Hi all
    Currently, what connection of the user to the BPM and create the new instance of the task, I can get the roles and this user by programming groups. I want to assign roles to user for this task instance dynamically when the user click on the "SUBMIT" button (because I want to limit the users belong role are able to perform this task, each user belongs to a role and group can do).

    Help someone?

    Thank you.

    Hi Ming
    1. If you want to catch all the Actions a task as Save, Submit, approve, reject etc., you can create your own class as MyAppTaskValidationCallback that implements oracle.bpel.services.workflow.task.ITaskValidationCallback and in it, overwrite a method named validateTaskOperation (bunch of parameters). To do this, see API.

    In this method, you can get the action performed on the task. You can also get the full charge of the task, including your custom load and the stuff of task standard payload as history, attachments, comments etc. You can write simple XML parser utility methods to get and set attributes in the payload xsd schema. So in your case, in this method, get roles, groups of the logged in user. Verification of the action. If it is not authorized to perform this operation, remove the error of this method. Otherwise, continue your logic. Create first class java as above, add this code snippet and explore data.

    Now, just curious. If your condition is really for control actions based on role/user groups, have you tried to use the output of the features and to avoid this custom logic. Say for the BPM Applications, we have the corridors / roles. Only users belonging to that role, can work on this task. Try to use tricks box as much as possible, unless you really need custom logic of assignment.

    Thank you
    Ravi Jegga

    The code snippet to get an idea just to give. But refer to the API online for more information.

    public void validateTaskOperation(ITaskValidationCallback.TaskAction taskAction, IWorkflowContext iWorkflowContext, Task task, Map parameters, Locale locale, List errors) {
    try {
      Element taskPayload = task.getPayloadAsElement();
      String taskTitle;
      String taskOutcome;
      SystemAttributesType taskSystemAttributes = task.getSystemAttributes();          
      taskTitle = task.getTitle();
      System.out.println("MyAppTaskValidationCallback::validateTaskOperation() Begin For TaskTitle: " + taskTitle + " -> TaskAction: " + taskAction + " -> Parameters:\n" + parameters);
      if(taskAction == TaskAction.ACQUIRE) {
          System.out.println("Inside ACQUIRE");
          //parameters.put("AcquiredBy", iWorkflowContext.getUser());
      } else if(taskAction == TaskAction.OUTCOME_UPDATE) {
        System.out.println("Inside OUTCOME_UPDATE");
    } catch (Exception anException) {
  • How can I change the content of a string when I click on an image?

    I have hundreds of images that need to play a unique sound when you click it.  In order to simplify the construction of this flash file, I need to simplify in a manner that will allow me to change one word.  Some examples of code.  I think that the reason why this does not work, what I'm declaring 'word' twice... suggestions anyone?  Thanks in advance...

    import flash.events.MouseEvent;


    var password: String = "family".

    trace (word + "_nv")

    This [word + "_nv"] .addEventListener (MouseEvent.CLICK, playaudio);

    This [word + "_nv"] .buttonMode = true;

    var password: String = "grandchildren".

    trace (word + "_nv")

    This [word + "_nv"] .addEventListener (MouseEvent.CLICK, playaudio);

    This [word + "_nv"] .buttonMode = true;

    function playaudio (event: MouseEvent): void {}

    this [word + "_nv"] .play)


    I see no where what you show is simplify anything.  This would save code in order to use only the strings rather than assign the string to variables and using variables.  In all cases. Yes, you do not want to declare the same variable twice (only use "var").  And your playaudio function will not work with whatever the last value of 'word' that you assign.

    To simplify the code, you can name each mc using a digital increment (mc_1, mc_2, mc_3, etc.), and then assign your headset in just a few lines by using a loop.  In audio playback function, you can use the name of the instance of the event.currentTarget.

    This [Event.currentTarget.Name]. Play();

    or even

    MovieClip (event.currentTarget) .play ();

  • Data on 'Back' button pressure only when the cursor is in the text field


    With the help of members of the forum, I understood how to use the 'Touch down?' event to send text series when the user presses the button «Back»  Is there any way I can limit this function so that the data is only sent when the cursor is in or on the correct text box AND the user presses the return key?

    Thank you very much.

    You will be most of the way, if you change the event handled in a key event down to the control of the string, rather than for all VI.  This way, you haven't really even to worry about key priorities.  You have control over the "Limit to the single line" value chain so the new line in fact will not be added to the string, but you will always have the event.

    The other problem is that you read the value of string outside of the structure of the event, so the value you write to the indicator will be flawed when it is written.  The string value is not actually until you press the Enter key.  The event fires at the point where you hit enter so that it uses the value that is on the line at the time, which is the value before you hit enter, then your indicator gets old.  There are several possible solutions.  A simple, but not necessarily good option must set "Update of value while typing" and assumes that the user will always wait for at least 10 ms between the last strike and enter.  Of course, if you increase the timeout value you may miss some characters, and there isn't really a need for a case of timeout to all in the structure of your event (just another case for the power button).  Putting control of the Terminal string inside the structure of the event does not solve the problem - again, the event occurs before the new value is treated - but, oddly enough, reading the value of a property within the structure of the event node works (while reading a local variable does not work).  It could also save a dynamic event that triggers the update based on the control indicator.  You can add a registry to offset Boolean to act as a flag and handle the case of the value has changed for the control of the chain as well.  In the case of the value has changed, if the Boolean value is set, updated to the indicator and always set to Boolean false.

    Sorry it's all rather complicated, there are quirks to LabVIEW treatment event.  Reliable the more straightforward approach is probably reading the control value of the string to a property node in the case of the event.  While property nodes are not generally recommended, especially for obtaining or the settting a value when the terminal is on the same side, in this case I think that it is the least complicated solution.

  • How can you say [inputChan] = ' / Dev1 / ai0:7, Dev1 / ai16:23, / Dev1/ai32: "in LV 8.51


    Card PCI - 6225 DAQ a CBS, an expression of CSC block. Were released in a Mac G5 with routines c, but now need to move the DAQ card in a XP box and use LV 8.5.1.  you will need to start a task for 2500 samples on 17 differential channels and prefers to use the DAQmx screws (I think) to change the number of samples, etc. programmatically, rather than tasks set Max or to express screws.  Calendar clock sample, triggers, etc. are simple screws c, but I don't get the string formatting in DAQCreateVirtualChannel.vi for example.

    Thank you


    Why wait for 8 channels, see when you have 16 defined in the list of physical channels? I don't think you quite understand how channels are used in differential mode. Ai0 is paired with ai8, ai1 is paried with ai9, etc.. Specifying ai0 and differential mode, ai8 is automatically used. DO not specify - mode bonus entries and that you can NOT pair ai0 with ai16. If you use the differential mode of traditional DAQ or in another language, nothing is different with LabVIEW.

  • NEITHER 9212 - issues with sampling frequency, number of samples and size of buffer or slowness comes together with thermocouple module

    To begin with, I am very new to labview and unfortunately on that my first task is to build something rather complicated for a project that my company works. Fortunately it is especially followed rather than control critical processes.

    Currently, I have a cDAQ with modules, DI, AO, and TC.


    NEITHER 9472

    NEITHER 9421

    NEITHER 9263

    NEITHER 9205

    NEITHER 9212

    I'm currently running read-write for all 5 of these modules in parallel while loops and analog and digital inputs/outputs modules that all work as expected. Each loop requires 1 sample per channel through the wizard DAQmx etc for each module and I got can interact with all the asyncronosly inputs and outputs which at the moment is the goal. I can switch power switch for each module save memory, or if the need arrives later.

    My problem is that the module TC (NI 9212) when tilt on which allows the acquisition of sample 1 loop seems to take much, much longer to collect samples. I have played with different acquisition parameters and can seem to get a continuous flow of data when you use streaming samples, or even when specifying N-samples but I come in questions where the "application cannot catch up with the hardware.

    I tried to find an optimal number of samples/sampling, rate, etc I can get an update of temperature more than every 1 to 2 seconds, but if I set the number of samples that are high enough to apparently get a constant flow, what ends up happening waveform graphs seem to lag behind the actual data, and that's where I get errors. I only want 1 sample per channel per cycle anyway. Yet once, all the other modules in the cycle with less than 100ms delay between acquisitions but the module thermocouple ends up being 1-2 seconds. It's okay because in our application temperature should not rise/drop very quickly but its boring nonetheless.

    I have the acquisition set up for the same (NI 9212) thermocouple module was like my modules of analog and digital inputs (NI 9205 and NI 9421) take 1 sample every time the task is called so I'm having a hard time understand why do the same for the TC module introduced such a delay. Max sampling rate is supposed to be 95 samples/s/ch, so I guess that the delay must come from call the task over and over again in a loop.

    Synchronization and how you have configured the 9212?

    In the case of high resolution, it can reach 1.8 samples/s. see page 7 of the plug technique here for rates for the supported modes:



  • Face recognition

    Why all the faces are detected?  I have pictures that the face recognition does not pick up on. How can I add them?

    You ask about the opening or the Photos.app face recognition? On a Mac or on a mobile device?

    Face recognition is a very complicated task. The algorithm of recognition of face in the Photos has been greatly improved with macOS Sierra and iOS 10, but it is still not as good as the human visual system to recognize faces in a photo.

    In applications of photos on a Mac you can add manually, faces that have been missed by the face detection, but this is not possible in the Photos on the iPhone or iPad.

    In the use of the opening ' photos > faces missing Detect "to rescan the photos selected.  And use "metadata > assign names" to name the faces detected and assign the additional faces images.

  • NetInstall vs Profile Manager


    For years, I am using NetInstall unroll my Mac to my 50ish users. As typical, I created a machine exactly as I want.  When I buy a new machine (or decide to reimage an old), I start to restore image, change the name of the account, copy the files, change some applications and settings and done.

    I keep reading (and the Apple business team have alluded to) the fact that the Profile Manager is supposed to do something similar, but I am at a loss why I would use rather than what I do. It seems more oriented toward mobile devices and also seems rather complicated to install and manage. Maybe it's me, but it seems to make more sense to implement a customer while I am interested in it if the dock and different options are exactly what I want.

    Then, someone actually uses the profile for computers Manager? And what are the benefits on the fair site from scratch and copying users files to a computer newly set up, the way I did?

    Thank you

    The f

    Profile Manager allows you to set parameters for individual users, for individual computers, user groups, groups of machines, groups of. If you want to change a parameter that takes a few seconds and change is pushed towards the target automagically. You will want to get a copy of Apple Remote Desktop, you can use to install the packages and files.

    In comparison, "Re-imaging from scratch" is slow and inflexible.


Maybe you are looking for