Array to spreadshee​t string. Empty formatter ignored. BUG

when you want to create an array string that has no seperator you cannot use the Array To spreadsheet string function:
This is a bug in my opinion.
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!

smercurio_fc wrote:
This has been a known issue for a LONG time. Technically, it's not a bug since the behavior of the function is correct based on its design. It uses a default value of a tab if it receives an empty string. It's no different than with VIs having a default value for a control.
I disagree with that. Our own VIs behave like that since we don't know if anything is wired to a terminal or not. But many LV primitives work differently if you wire something or not. Index Array for 2D or higher dimension arrays for instance works differently when wiring a 0 (default value) or leaving the terminal unwired.
So I would expect the primitive to accept an empty string.

Similar Messages

  • Array to Spreadshee​t String VI truncating my rows

    I'm using Labview 8.0.
    In my VI I am feeding the "Array to Spreadsheet String" VI an array of strings that are in the following format.
    7/09/2010 7:43:23.27472 95.284953
    7/09/2010 7:43:23.27572 95.284953
    7/09/2010 7:43:23.27672 95.284953
    7/09/2010 7:43:23.27772 95.284953
    The first entry is the data, then time, then data.
    The problem I am having is that when I pass this array of strings through the "Array to Spreadsheet String" VI it cuts off the entries and I get the following:
    07/
    07/
    07/
    07/
    The format I feed to the VI is <%s> for string. Any help would be great. Thanks!
    Solved!
    Go to Solution.

    Hi Emike,
    for me this works:
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Array To Spreadsheet String, Empty Delimiter

    The Array To Spreadsheet String function does not accept an empty Delimiter, it uses the Tab character in such case.
    The same is true for the Spreadsheet String To Array function (but of course this function cannot work without a Delimiter).
    I would appreciate one of the following options:
    to allow an empty separator for both functions (for Array To Spreadsheet String this can easily work obviously; for Spreadsheet String To Array you might see an empty string delimiter between each two adjacent characters similar to the Search and Replace String function with an empty search string);
    to document that behaviour properly;
    I would prefer the first option espacially for the Array To Spreadsheet String function. What do you think?

    Hi aschipfl,
    some thoughts about your suggestion:
    - When you want to suggest improvements to LabVIEW you should post in the Idea Exchange.
    - NI will not change the behaviour of functions existing for a long time…
    - NI will probably update the LabVIEW help for that function…
    - a spreadsheet string needs some kind of delimiter, what's the purpose of creating a spreadsheet string without them?
    When you really need a "Array to Spreadsheet String" without delimiters you could take this approach:

  • Need help, trying to print strings backwards while ignoring certain things.

    To clarify the topic what I mean is I want to spell the words the user inputs backwards while skipping over certain characters. Here's my code:
    import javax.swing.*;
    import java.util.*;
    import java.text.*;
    import java.io.*;
    class SConvert{
    private static final char BLANK = ' ';
    private static final String stop = "STOP";
    public static void main(String[] args){
    char[] ignore = new char[21];
    ignore[0] = '.';
    ignore[1] = '/';
    ignore[2] = '>';
    ignore[3] = '<';
    ignore[4] = ',';
    ignore[5] = '?';
    ignore[6] = '-';
    ignore[7] = '~';
    ignore[8] = '!';
    ignore[9] = '@';
    ignore[10] = '#';
    ignore[11] = '$';
    ignore[12] = '*';
    ignore[13] = '&';
    ignore[14] = '^';
    ignore[15] = '%';
    ignore[16] = '`';
    ignore[17] = '_';
    ignore[18] = '+';
    ignore[19] = '=';
    ignore[20] = '|';
    String word, statement, append;
    boolean go = true;
    int i, numOfchar, index;
    char[] chr;
    index = 0;
    word = " ";
    statement = " ";
    append = " ";
    Scanner scanner = new Scanner(System.in);
    while (go){
    System.out.println("Enter a word");
    word = scanner.next();
    chr = word.toCharArray();
    numOfchar = word.length();
    if (word.equals(stop)){
         break;
    else if (index < numOfchar && word.charAt(index) == BLANK + BLANK){
         index = BLANK;
    else if (index < numOfchar && word.charAt(index) == (int)ignore[19]){ //Trying to range for entire array, I don't know how.
         index++;
    else
           for (i = word.length() - 1; i >= 0; i--)
              statement = statement + chr;
              append = append + " " + statement;
    System.out.print(append + " ");
    What's messing me up is the fact that whenever I try to enter words into the program, printing append only repeat EVERY occurance of statement. For example, say I type in "Ham with gravy." I get "maH htiwmaH yvarghtiwmaH".
    That's not what I want. Also, I don't know how to make the entire array of ignore available to the program, anyway to do that?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Wow. What's with the hostility? Even I was in error of detecting anything that could have solve the problem completely there's no need to use such a negative tone, epsecaility with someone who is learning to program in OOP, let alone the syntax of Java. Also, no your program did not solve all of my problems in it's original form. Let's take a look at it.
    Here's your code:
    import java.lang.String;
    import java.util.*;
    public class ReverseString {
      public void ReverseString(){
      public void printReverse(String s){
         int i;
        String noPrint = "no print'";
        char ch = '*';
        if(s.length()>1) printReverse(s.substring(1));
         ch = s.charAt(0);
        if (!noPrint.contains(ch + " ")) System.out.print(ch);
        return;
      public static void main(String[] args) {
          String myString = Here is my String.;
       System.out.print("My String: " + myString + " Reverse: ");
       new ReverseString().printReverse(add);
       System.out.println();
    }In it's original state the program doesn't allow for any user input, which is something I needed (and added on my own), it doesn't convert the ignore[] I had in my original code to anything readable (however this can be done in the noprint String quite easy as someone else mentioned earlier.) the if command does in fact ignore the special characters in noprint String HOWEVER it doesn' t not print those characters as they would appear in the myString String in the position that it original appeared in (which is the primary problem I am having.) That is the problem with your code and why it is not the complete to soultion to my homework problem. I've modified your code to satisifed all but one of the problems.
    Modified:
    import java.lang.String;
    import java.util.*;
    public class ReverseString {
      public void ReverseString(){
      public void printReverse(String s){
         int i;
        String noPrint = "~`!@#$%^&()-=+[{]}\':;?/>.<,'";
        char ch = '*';
        if(s.length()>1) printReverse(s.substring(1));
         ch = s.charAt(0);
        if (!noPrint.contains(ch + " ")) System.out.print(ch);
        return;
      public static void main(String[] args) {
           Scanner scanner = new Scanner(System.in);
          String myString;
          String add = " ";
           while (true) {
       System.out.println("Please input String.");
       myString = scanner.next();
       add = add + myString;
              if (myString.equals("STOP")){
                   break;
       System.out.print("My String: " + add + " Reverse: ");
       new ReverseString().printReverse(add);
       System.out.println();
    }If you run this code you'll see what am talking about. The only remaining problem, which I am about to restate if you are still unclear of it, is that the noprint String contents are ignored but not printed in the original position. If you are still having trouble understanding what I am talking about then let me show what I got by running the program.
    String: Ham with grav?y
    Reverse: yvarg htiw maH. [Note the ? is missing.]
    By removing the ! in the if command I get:
    Reverse: y?varg htiw maH. [Now the ? is in the wrong position.]
    It's suppose to be:
    String: Ham with grav?y
    Reverse: yvarg htiw ma?H.
    Secondly, I understand that you are frustrated with my apparent lack of understanding of proper Java tems and syntax but you must keep in mind I am student thus I am not fully aware of java as you are. With that one would expect you to act with a bit more patience, yet you not only took offense to an innocent comment you choose to slander my name and intelligence by erasing your code and calling my understanding of Java, ?ignorant.? I may be less than careful with my choice of words concerning Java but I do understand enough code to know the inner workings of a typical program, so please refrain from calling me ignorant or any variant of this in the future.
    I merely asked for help from general populous, do not think I owe you any particular praise for your code even if I find it is not exactly what I desired. I may be new to java but I am not new the message boards. With that said I find your response awfully rude and ask if you to refrain from do so in the future. I'm assuming you are an adult so act least act like someone with a bit of civility. If you were so committed to believing your code was the de facto solution to this problem then you could have simply asked why I say what I said, if had done so and shown me the error of my statement I would have not taken offense. Instead you choose to throw a fit and deleted your code. I do not know if you are like this around other board members but you should at least show courtesy to all members of this forum regardless of their time here.
    With that said, I think I've all ready found a solution to this problem I've had. I'll just tell the program to simply count over the position the character is in. That way it will stay in the same position.

  • Array of Ring to string value for creating a table

    I want to convert an array of ring to string and generate a table from it.
    But using property node for converting each ring is changing all the value of the table!
    each array represents different register!hence required to change  for different array! 
    i am hereby attaching a  Vi!
    Solved!
    Go to Solution.
    Attachments:
    Untitled 1.vi ‏1944 KB

    How about this simple solution? Array of a ring control to Array of string.
    /Y
    Message Edited by Yamaeda on 04-13-2010 08:36 AM
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Array to one line string

    hi i have an array
    as this
    0123456
    6789456
    but i want my array to be as 01234566789456...
    anyone can help me on tis

    Hi jeyanthi,
    if you connect your array to the "Concatenate Strings" function, then you get what you want.
    Mike

  • Converting Image to Byte Array and then to String

    Hi All...
    Can anyone please help me. I have got a problem while converting a Byte array of BufferedImage to String.
    This is my code, First i convert a BufferedImage to a byte array using ImageIO.wirte
    public String dirName="C:\\image";
    ByteArrayOutputStream baos=new ByteArrayOutputStream(1000);
    BufferedImage img=ImageIO.read(new File(dirName,"red.jpg"));
    ImageIO.write(img, "jpg", baos);
    baos.flush();
    byte[] resultimage=baos.toByteArray();
    baos.close();
    Then i tried to convert this byte array to a string
    String str=new String(resultimage);
    byte[] b=str.getBytes();
    This much worked fine. But when i reversed this process to re-create the image from that string. i found the image distroted.
    BufferedImage imag=ImageIO.read(new ByteArrayInputStream(b));
    ImageIO.write(imag, "jpg", new File(dirName,"snap.jpg"));
    I got this snap.jpg as distroted.
    Please help me i have to convert the image to a string and again i have to re-create the image from that string.

    To conver the bytearray to string use base64.encoding
    String base64String= Base64.encode(baos.toByteArray());
    To convert back use Base64.decode;
    byte[] bytearray = Base64.decode(base64String);
    BufferedImage imag=ImageIO.read(bytearray);

  • Como obtener un array dbl de un string de 2 bytes

    como obtener un array dbl de un string de 2 bytes
    Adjuntos:
    dbl.png ‏37 KB

    Hola, un string de dos bytes no puede contener un double ya que el dbl es un número de 8 bytes.
    Acaso estás recibiendo alguna medicion de un conversor de 16 bits (un instrumento externo, un PIC o algo así)? Si es así el valor correspondiente en la unidad de medición (V, A, RPM...) debe calcularse con
        bits recibidos / 65536 * máximo de la medición
    Ejemplo: en un voltímetro de 100V / 16 bits, un valor de 8000 (bits) equivale a una medición de 12.207V
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Array access notation with strings?

    I may be confused, but I thought you could use array access
    notation with strings. Can someone tell me why this code doesn't
    work (or suggest new code):
    the code is meant to rewrite the block of text in tText at a
    rate of one character per frame... (when the function is called
    once per frame) but it doesn't work.

    DZ-015,
    > I may be confused, but I thought you could use
    > array access notation with strings.
    It's made for objects, actually. The array access operator,
    [], allows
    you to access elements from an Array instance and also lets
    you access
    properties from any sort of object. The "trick" it provides,
    in this latter
    case, is that you can refer to these properties -- within the
    brackets --
    with strings, so it's often used to reference objects
    dynamically.
    > var sWorkingText:String = tText.text;
    Here you've declared a String variable and set it to the
    TextField.text
    property of some textfield. So far, so good.
    > var sNewText:String = oPhotoText[sPageFocus];
    Here, you've declared a String variable, but it seems that
    you're
    setting it to a property of the oPhotoText object. That's now
    how this
    works.
    The array access operator allows you to *use* strings to get
    at an
    object's properties:
    // functionally equivalent
    someObject.property1
    someObject["property" + 1];
    var x:Number = 1;
    someObject["property" + x];
    Does that help?
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Spreadshee​t String To Array DBL Performanc​e Improvemen​t

    While developing and profiling a batch data-analysis program, I found that the "Read From Spreadsheet File.vi" function was where the majority ofthe execution time was spent.  Digging further, I found the time was spent in the "Spreadsheet String To Array" function.  Obviously I cannot look inside this function, but I wondered if I can somehow speed it up.  Attached is a Vi that illustrates what I came up with as an alternative.
    Basically using "Spreadsheet String To Array" only to split it up to a 2D String Array, and then "Fract/Exp String to Number" to convert the strings to numbers.
    It consistently runs in just over 60% of the time of using Spreadsheet String To Array on it's own to do the conversion.
    I am curious as to why using the two functions is quicker than just the one on it's own? Perhaps NI can improve the internals a bit?  Or perhaps it is not a fair comparison?
    Labview 8.6f1 Win XP SP2
    Message Edited by pauldavey on 03-25-2009 02:55 PM
    Attachments:
    Speed Test Spreadsheet String to Array.vi ‏26 KB

    Adding a couple of other conversions to test against i noticed that:
    1. Scan from string through a double loop was the slowest
    2. Scan Value was slightly faster
    3. Direct conversion through Spreadsheet to array as in OP
    4. 2-step convert through Fract/Exp.
    Could it be that Spreadsheet to array uses Scan Value internally?
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Spreadshee​t string to array slow?

    We have an apllication here where we would like to save all our data 120
    files with 4M each and then read it back.
    I ve changed now to zipped files, but reading from the disk seems not to
    be the problem. I used 'profile' to analyze the time consumption. I
    think it might be the 'spreadsheet string to array VI' which makes it so
    slow, 1 second is a lot to sort 450k numbers. (BTW its a win2000 PC of
    this year)
    Any hints how to improve it?
    Best Regards
    Urs Bögli

    hi,
    I do this small program. Program generate, write and read array with double precision. I generated array with 1.000.000 rows and 10 columns. Read is fast in this program, because file is 'cached' in Windows Virtual Memory.
    When you close LabVIEW and try read file with second VI on my PC I need 3 second for this array [on the disk have file 80MB].
    It is programs in LabVIEW 7.0
    Attachments:
    readArrayFile.zip ‏186 KB

  • Spreadshee​t string to array notation

    Hi all,
    I am using the spreadsheet string to array function and basically my problem is as follows:
    My inputs are in scientific notation so I use this in string format. The data is separated with a ",". What I get is just the argument rounded.
    As I just realized I didn´t make myself clear I´ve attached a photo of the problem. Notice that probe 4 is the input from which I want to build the array, and probe 5 is the output. I just have the 9 but what happens with the rest of the number?
    PD: I´ve tried many formats but none of them seems to work.
    Thank for your help
    Solved!
    Go to Solution.
    Attachments:
    notation.png ‏145 KB

    Your system is set up to use a comma (,) as the decimal point?  Try using "%.;%^.3e" for your format.  The "%.;" tells the scan to use the period as the decimal point.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Array of cluster with string controll??

    Hello again!
    Now we have another type of problem. We have an array of clusters. The cluster is built by two controlers. One is a string and the other is a menu ring. How can we get a text in the strings that stays there even if one close the program. The text is supposed to be different. Example: B1, B2 and so on. then we want to be able to choos from a menu ring different options that are coupled with B1, B2 and so on. Best regards.

    Using "make current values default" will save a set of default values into all controls on the front panel. If you want the values to not just be default but be saved from run-to-run you need serialization of controls. When initializing controls (usually before the main user loop) you feed your controls data from a stored file and at the end of the program the settings are stored back (overwritten) to the same "preference" file. Reading and writing complex data forms might seem like it would be a pain to implement but Labview has a nice method for such data persistence. Use the Advanced>>Data Manipulation>>XML VI's. Flatten your control to XML using, you guest it, "Flatten to XML" then use write XML to file to save settings. Do the reverse to initialize controls by reading XML file and unflattening XML data. I have had nice results with these VIs in the past and although not the most compact data form (we are in the age of 100+GB hard drives so what's a few bytes between friends?) will give you well formatted data with almost no additional work. If you just want default data settings and not data persistence then ignore this message.
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • Initialize array from a constant string

    I generated the coefficients for a FIR filter in Mathscript (250 taps).  I dumped the values to a data file and then "load"ed them into a Mathscript box inside my vi. 
    This worked well until I created an executable version of my program (no Mathscript) where my coefficient vectors now come up Null.
    My idea is to text copy the coefficients into a string constant in my vi, and then initialize my array as part of my start-up routines.
    I was wondering if anyone has done this?  Is such a routine available anywhere?
    Thanks,
    Tom J

    How are you building the path the file that you are reading?
    When you build an executable, the path of the VIs it contains changes.
    In development environment, path to VI = c:\project\Top Level.vi
    In executable environment, path to VI = c:\project\Executable.exe\Top Level.vi
    So if the file you are reading is in the same directory as the executable, and you are building a path relative to that, you need to strip one more path level for the executable.
    The above image shows one way to do determine programmatically if you are in the development or executable environment and how to strip the path an extra time for the RTE.
    If this is not the problem, kindly ignore everything I just rambled on about.
    Ed
    Message Edited by Ed Dickens on 02-22-2007 10:36 AM
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    Strip Path RTE.gif ‏4 KB

  • Arrays or Spreadshee​ts? Help with School Excercise

    Hello there, my Control Systems Engineering professor will make us a LabView test in a couple of weeks, although he won't actually teach us the software, but rather we need to get our hands dirty. Anyways, I'm trying to resolve this excercise:
    Problem Definition.
    On a storage area of a container terminal containers are stored temporarily waiting for further transportation. The location of a specific container along with its code is stored in a database. Whenever the operator types in the code of a container, the according location is shown on the screen.
    Demands.
    - Take as storing area a rectangle of 3 rows of 4 positions horizontal and 2 positions vertical (24 containers).
    - Each containers is identified by a unique alphanumerical code of 11 digits. Digit # 11 is the check digit, being the last digit of the sum of the previous 10 digits based upon the ASCII table.
    - When filling the database, the user myst apply the code of the container and its location.
    - When searching for a container, the operator applies only the code of the container. On the front panel the according location must be displayed by the program.
    - If a container is not found it must be reported by means of an error message.
    - If an incorrect container code is inserted it must be reported by means of an error message.
    What I've done so far:
    I've made a UI and code so that I can type a 11 digit string and the VI will indicate me if its a valid code or not, based in the comparison of the 11th digit.
    What I need:
    Next step, I believe, is that if the code is valid, I should store it in a database along its position. I know that there is a Database toolkit for LabView, but you must agree it is impractical as this is just an excercise. I was thinking about making an array or a spreadsheet, but have no experience with it. Also it seems that arrays work best with For and While Loops, but I might be wrong... and how can the user assign its position?
    Well, thanks all in advance for ANY suggestions. Everything is welcome.
    Pohl.

    Hello,
    Take a look at the following link:
    http://zone.ni.com/reference/en-XX/help/371361B-01​/lverror/too_few_format_specifiers/
    it explains this error and also gives a link to the format you should use for this function.
    Regards,
    RikP - National Instruments Applications Engineering
    Rik Prins, CLD
    Applications Engineering Specialist Northern Europe, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

Maybe you are looking for

  • Can't open MAIL, iCal or Preview

    Please excuse me... I'm in a learning mode in using this Apple Support Communities medium. I clicked that my reply answered my problem as my issue suddenly resolved itself when in fact I still have the same problem and more. On 12-Jul-2012 10:09 AM I

  • Adobe AIR Installer Crashes - Mac OS 10.4.11

    I've tried the International workaround to no avail. Here's what I get from the Console: 2008-12-17 23:24:31.879 Adobe AIR Installer[988] *** +[WebFontCache fontWithFamily:traits:weight:size:]: selector not recognized 2008-12-17 23:24:31.879 Adobe AI

  • How do I upload a new cd to itunes match?

    I have uploaded a new CD I just bought to iTunes and would like to upload it to my iTunes Match account, but it will not upload.  Any ideas?

  • Project layout and themes missing PSE7

    Hello, Now and then when i turn on my computer , which is running Windows XP I click on the Adobe photoshop Elements 7 icon. Once the PSE 7 welcome screen appears i click on organize, this brings up some previous photos ive imported with key word tag

  • How to display flash version, air version, etc.

    Hi flex community, I wanted to know how can I display the version number of my own project, the adobe air version, the flash version, the operating system, the processor, the ram installed of the users system in a label. king regards flexx0r