Format Into String

Hello all,
I would like to format a string with "a white space" between each
string member. i am at odds as for the format, for the "format
string" in the Format Into String function. let me rephrase that...
the format which needs to be used to format the "FORMAT STRING" in the
Format Into String function.
i looked at the help, but it seemed very nebulous to me. all i need is
to have "a white space" or a "carriage return" between the string
members and store it to a file.
thank you,
cheers,
-U

> I would like to format a string with "a white space" between each
> string member. i am at odds as for the format, for the "format
> string" in the Format Into String function. let me rephrase that...
> the format which needs to be used to format the "FORMAT STRING" in the
> Format Into String function.
>
> i looked at the help, but it seemed very nebulous to me. all i need is
> to have "a white space" or a "carriage return" between the string
> members and store it to a file.
>
The format string is basically what ANSI C uses, but that string
function has a dialog to help you build it. Either double click the
node or right click and use the last item.
In the dialog, you can place a format string followed by an exact string
followed by another format
string. For the exact string you can enter a
space to output a white space, but to do a carriage return you have to
use a \n or \r.
Another way to do this, which I think is much easier and easier to read,
is to use the Concatonate Strings node with three inputs. To the top
wire the first string, to the middle wire a string constant from the
next to last row. This is a much cleaner way to do the constants. And
on the bottom input put the other string.
Format into String is much more powerful when appending many types of
data, but the simple append is clearer when it is powerful enough.
Greg McKaskle

Similar Messages

  • Format into string 16 bit signed integer

    Is there any format specifier string for "Format into string", whereas the result is an I16 string?
    My problem is when I use "%d" and the input string is 65535, the result string should be "-1".
    Solved!
    Go to Solution.

    Are you trying to get an integer out of an ASCII string (Scan from String) or turn an integer into a string (Format into String).  You title and question seem to contradict each other.
    Assuming you are trying to scan from string, it looks like you need to scan into a U16 and then use a conversion bullet to turn it into an I16.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Scan I16.png ‏11 KB

  • How not to omit leading binary zeros with format into string

    I'm using format into string to format serial data .  The problem I'm having is that Format into String with "%b" format identifier omits leading zeros
    in the string..   ie...  "3" becomes "11" when I need it as "0011"
    Solved!
    Go to Solution.

    see figure:
    Attachments:
    Example_VI.png ‏3 KB

  • Regular expression or format into string (nevermind)

    Solved it,
    I can use string to fractional number!
    Hi,
    I have a 2D string array from a multicolumn list box, and i want to check if every value is valid number, the numbers can be a single and can have negative values. Does anyone knows which regular expression i need to check this, or is there an ever better way doing it?
    Best regards,
    Thijs
    Solved!
    Go to Solution.

    You shoudl post your solution so others who have a similar issue can learn from how you solved it.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Can anyone answer this question? What is used to format a string so that it falls into a certain Row/Column in excel? see text for indepth question.

    I'm attaching a file that may help. Just remember this is my FIRST attempt at using NI/FeildPoint so things that would be obvious to the normal users more than likely would slide right by me. So I'll try and explain what the text contains as to make my problem more clear. I'm using a FP-1000, FP-AI-100, and a FP-TB-10. i'm creating a application where I'm using the 8 channels from the FP-AI-100 to monitor a control system ,that we manufacture. The control system is in an environmental chamber. I use the FP-TB-10 to monitor the temperature while in the chamber. The control system is ran for 4 hours under varing enviromental conditions while I monitor vital system voltages with the FP-AI-100. Now the application that i'm building starts with the obvious FP CREATE.VI and so forth I have no problem communicating with the FP's, but the information that I'm monitioring needs to be placed into a file with Headers describing the information below it. Now I use a "WHILE LOOP.VI" to monitor the FP-AI-100 & FP-TB-10 for the 4 hour period. but before that I create and open a file where I use a "CONCATENATE STRINGS.VI" to enter the headers I need. I do this by CONSTANTS, CONTROLS, TABs, AND CARRIAGE RETURN being entered into the "CONCATENATE STRINGS.VI" in the order I want them to appear. I use ROW 1 to enter (OPERATOR:with a CONSTANT) an a (CONTROL so the operator may enter his name and be recorded into the file) using a TAB to seperate Columns and a CARRIAGE RETURNto drop down to ROW 2 for the next headers. I use header names and TABs to seperate the columns. This part works great. I end up with ROW 1 having the operator information then ROW 2 having the headers for all the channels I'm using to monitor the control system with in their own column. The trouble happens when I write to this file during the "WHILE LOOP". The information recorded for DATE:, TIME:, and Channel 0 of the FP-AI-100 end up right under their corresponding header on ROW 3, but the rest of the data ends up on ROW 4 in column 3 and goes down many rows with some of the data not being stored at all. It varies on how many rows are used starting at ROW 4 but hey always stay in column 3. I use the "FP READ.VI" outputing to a "ARRAY TO SPREADSHEET STRING.VI" outputing to a "CONCATENATE STRINGS.VI" for each channel within the "WHILE LOOP" then into the "WRITE.VI". I use the "CONCATENATE STRINGS.VI" to place my data OR atleast I thought you could do that some how I'm not quit doing something write either there is a sampling/timing issue or writing to file issue where things are being confused in the "WHILE LOOP" if someone know a better route to perform what I'm tring here I would be interested. Its not like I'm not giving it the old colledge try here but without proper training and the vagness of the manuals it's difficult to understand what every connection actually does.I'm tring though for everyone who happens to fill pity for me
    Thanks for your help
    John Morris
    Glendinning Marine Product, Inc.
    Attachments:
    ALLchannels ‏273 KB

    > I appreciate your effort to help me, but there is still a slight cloud
    > in front of my eyes here.(I must mention that I'm using Labview 5.1
    Oh, to bad. I'm using LV 6,02 and tried to save the application as LV5.1,
    but it didn't work.
    > Lets start with the easy one which is the SECOND main thing you
    > wanted to mention. In my application I used individual Create Tag.vi's
    > "so your saying that I can use just one Create Tag.vi and one Read.vi
    > and what ever I use to display the values will automatically to show
    > the individual channels" in other words if I use a "Indicator(DBL)"
    > comming out of the Read.vi what ever I use in the "PANEL" layout will
    > expand to show all 8 channel if I was using a FP-AI-100? Cool...
    Allmost right. The 8 channels come out as 1D-array, ch0...ch7.
    > #1--How do I change the delimiter (TAB) to a delimiter (comma) in a
    > Array to Spreadsheet String.vi?
    > ...cut
    I don't use this Spreadsheet VI, because files coming out there allways
    start this time consuming EXCEL wizzard. Because of this, I programmed my
    own CSV-conversion vi. Maybe you could just use a common texteditor, like
    wordpad and put the csv-examples from my last reply down to a text file
    and rename it to *.csv. Texteditors terminate lines with "\r\n" by
    default, so this is a very quick way for testing.
    > FP_Analog_Logging example to record all eight channels it uses a Array
    I didn't find the vi you metione above, but there is another good one:
    Look at examples\FieldPoint\DataLogging\FP Logger.vi.
    In a little case structure, at "false", there is a function called "Format
    into string".
    Pop up on the format string and adjust >>'\' Codes Display<<.
    Then you change the format string into: %.;%-f%s
    A Tab string is connected to the lower input of this function. Replace
    this one with a comma.
    That should do.
    >
    > #2--If using just one Create Tag.vi and one Read.vi and I have the
    > Item Name listed as ALL I take it that the information comming out of
    > the Read.vi is data for each channel in a String format starting with
    > channel 0 and ending with channel 7 for the FP-AI-100.
    Yes, just as explained above. If you put a indicator at the output to
    display the values, you can expand the display to show all 8 channels, but
    you can't name induvidual cells. In a array, all cells have identical
    named labels. If you want to name the individually, you have to attach the
    array to cluster function and put the indicator after this one. Enable
    labe display and name the output values individually.
    > #3--Now I use the following to "Format String" in the Array to
    > Spreadsheet string.vi (%.4f)but I don't see anyway of changing the
    > delimiter from (TAB) to (COMA)
    Explained above.
    > #4 you stated text strings need a "as prefix and sufix" and each
    > string is seperated by a coma, a period is used as decimal number
    > separator and lines have to be terminated by my question is
    > WHERE IS THIS ACCOMPLISHED? WHAT VI OR WHAT CONNECTOR PIN?
    Well, modifying strings are done with string functions.
    Above, as I explained how the sample FP Logger.vi can be modified to do
    the job for numbers. The pre- and suffixing with ", you only need for
    strings, which EXCEL should interpret a string and as nothing else as a
    string, even if there's a number inside. You usually need this only for
    headers. So its easyest, if you just write your string into a string
    constant or control and concatenate it to the previous csv-file contents.
    Oh, I just see by looking at the above mentioned example... Inside the
    case structure, but in the "true" case, there are error messages
    concatenated to the logfile. At this point it is importent, to use " for
    integrating the message into the CSV file, because a error message usually
    looks like this: >> ERROR 2345 in vi yxz <<
    Here you have text and number strings mixed in one line. EXCEL does not
    know, if it should interpret the number inside the error line as separate
    number, separating the line into three colums i.e. string before number,
    number and string after number. So tell EXCEL by putting a " before and
    after the line each.
    For this, expand the Format To String function by one input, move down all
    connections, to be able to insert a string constant with a " to the first
    argument connector. Change the contents of the string constant at the
    bottom argument from tab to ", (quotation mark AND comma)
    > #5 You gave me an example of what a 3 column header could look like:
    > "col0","col1","col2"\r\n Now is this something that you enter
    > somewhere cause I know that \r is carriage return and \n is newline so
    > I take it that the above is entered somewhere maybe in the Write.vi to
    > the connector called Header (F)? See this is what confuses me because
    > NI manuals have no examples of certain connectors types being used or
    > any reference as to how they manipluate data with there varing type
    > inputs. Or maybe I'm just missing them.
    The example I mentioned above help here to.
    Look at the Write File function. This function receves data from a
    function named concatenate strings. Expand this function to have one more
    spare input at the bottom. Create a string constant. Switch the constant
    display to "\" mode. Enter "col0","col1","col2"\r\n into the constant.
    Connect the constant to the spare input.
    Doing this, every dataline in the csv file is followed by
    "col0","col1","col2"\r\n .
    I wish you a nice weekend,
    Rainer Ehrt

  • Format into SI string (always kHz)

    Hello,
    I'm reading DBL sample rate values from different RF bands and using the value to create a file header in order to store complex 32IQ binary data to file. I'm using the format into string function to do this but I always want the sample rate to be represented in kHz and I haven't thought of a way to force this to always be the case. I'm using a format string of %.3p which for sample rates such as 13125 and 400000 it returns 13.125k and 400.000k respectively and that is what I want. However, one of my bands is 3750000 Hz and the format into string returns 3.750M. I would like it to return 3750.000k instead. Anyone have any ideas on how I could accomplish this?
    Thank you,
    Tim
    Tim Sileo
    RF Field Account Specialist
    National Instruments
    You don’t stop running because you get old. You get old because you stop running. -Jack Kirk, From "Born to Run" by Christopher McDougall.
    Solved!
    Go to Solution.

    I would guss that the internal code that shows the SI units is using the 'multiples of three' flag to determine the magnitude. If you use the advanced properties to select between engineering and SI units, the 'multiples of three' box is disabled when you select SI. 
    I experimented with various display formats, but could not get the combination you indicated.
    I believe the SI standard reccommends that prefixes for which the exponent is divisible by three are used.( http://en.wikipedia.org/wiki/SI_prefix#List_of_SI_​prefixes )
    LabVIEW is displaying the number to the SI standard. Your desired display type is not standard SI units (although it may be common and practical in your environment/industry).
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Formatting a string with time stamp and double precision numbers

    %s\t%f\r%f
    This is a format string that I have in old code that I've decided to change.  Problem is I cannot make sense of the string codes in my own old code! Let me explain what I want, and hopefully someone can explain how to do it.
    I am using the format into string subvi to merge a time stamp (formatted as %m%d%Y%H%M%S%5u) and two different double precision numbers.  This string is then wired into the Write Characters to File subvi so that I can record data as a .txt file, and open it in either Matlab or Excel.  There is a minor problem with the string format above because in excel the first time stamp entry is blank, and the first loop only gives the two double precision numbers withouth the time stamp - the time stamp appears in the next loop (probably a looping issue and not due to the string format, but if you see differently please let me know).  Now what I want to do is 1. potentially fix that problem and 2. add some more doubles. 
    1. Is there a string format issue that is evident that I am not seeing that causes the time stamp to be formatted into the string after a carriage return?  Or should I be looking at looping issues?
    2. How do I add another one - three floating point numbers (double precision)?  Are the \'s marking different numbers in this string constant?  Or is it the %?  I can't find any information about the \'s, but I see that % begins the format specifier. 
    Ideally, I want these data in the following columns:  Date, Time(absolute), FP, FP, FP, carriage return for the next loop (FP is floating point double precision number).
    Thanks,
    Brad

    Hi JonN,
    Here there is no need of string concordinate function (in your code), the same result you can find if you connect the output of the format string to shift register, and shift register in data to initialize string connector in format into string function.
    <<KUDOS ARE WELCOME>>
    ELECTRO SAM
    For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.
    - John 3:16

  • Format Into File bug, repost#2

    Dear All,
    I have found a strange bug/feature in Format Into File.  A 3 digit integer number argument (eg. 123) together with the format string " %04d" should result in " 0123" being written to file but instead fails with error cluster;
    STATUS=TRUE
    CODE=4
    SOURCE=Format Into String in format_into_file_bug.vi. 
    I have appended a demo VI. Can anybody reproduce /explain this? My platform is WINXP Pro, LV6.1
    Thanks
    Tom Crane
    Ps. *Please* can anyone tell me how to delete unwanted posts from this BBS?  I find hitting the TAB key in IE -- a pretty innocent activity, which I constantly do without thinking results in multiple aborted posts, which I cannot see how to remove.  My apologies for those posts.  

    I have tried your demo using LabVIEW V7.11.  Worked out of the box, no errors.  I do not have LV V6.1 on any machines.  Have you tried using the format into string and then the write characters to file? Instead of the format to file function?
    Paul <--Always Learning!!!
    sense and simplicity.
    Browse my sample VIs?

  • Format Into File bug, repost

    Dear All,
    I

    I have tried your demo using LabVIEW V7.11.  Worked out of the box, no errors.  I do not have LV V6.1 on any machines.  Have you tried using the format into string and then the write characters to file? Instead of the format to file function?
    Paul <--Always Learning!!!
    sense and simplicity.
    Browse my sample VIs?

  • How to convert BLOB data into string format.

    Hi,
    I have problem while converting blob data into string format.
    for example,
    Select dbms_lob.substr(c.shape.Get_wkb(),4000,1) from geotable c
    will get me the first 4000 byte of BLOB .
    When i using SQL as i did above,the max length is 4000, but i can get 32K using plsql as below:
    declare
    my_var CLOB;
    BEGIN
    for x in (Select X from T)
    loop
    my_var:=dbms_lob.substr(x.X,32767,1)
    end loop
    return my_var;
    I comfortably convert 32k BLOB field to string.
    My problem is how to convert blob to varchar having size more than 32K.
    Please help me to resolve this,
    Thanx in advance for the support,
    Nilesh

    Nilesh,
    . . . .The result of get_wkb() will not be human readable (all values are encoded into some binary format).
    SELECT utl_raw.cast_to_varchar2(tbl.geometry.get_wkt()) from FeatureTable tbl;
    -- resulting string:
        ☺AW(⌂özßHAA
    Å\(÷. . . .You may also want to have a look at { dbms_lob | http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#i1015792 } "The DBMS_LOB package provides subprograms to operate on BLOBs, CLOBs, NCLOBs, BFILEs, and temporary LOBs."
    Regards,
    Noel

  • Formatting a timestamp into string with $ specifier

    Formatting a timestamp into string with $ specifier does not work; the formatted string is empty and no error is reported:
    I have forced the width to 10 to show that the format is at least partially scanned but when it is omitted the timestamp field is empty.
    I couldn't find this problem reported/addressed so here it is (LabVIEW 8.6)
    LabVIEW, C'est LabVIEW

    Yes, the simple work around is to put the timestamp first in both the string and the inputs.  But this is a bug.  There is no doubt about that.  A high priority?  Probably not.  Something that should be looked for when doing a revamp of the Format String?  Yep.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to convert JAVA.SQL.DATE date in YYYY/MM/DD format into DD/MM/YYYY

    i am using informix database which accepts date value in the form of DATE format......
    the other part of my application takes date from the field in DD/MM/YYYY format...so i have to convert my java.sql.date in YYYY/MM/DD fromat into DD/MM/YYYY fromat of same type before inserting into db......
    but using parse method in SimpleDateFormat class can get the result only in java.util.date format...
    and also using format method can result only in string conversion........

    816399 wrote:
    i am using informix database which accepts date value in the form of DATE format......Huh?
    Maybe you mean Informix (fronted by JDBC) expects date values as java.sql.Date objects?
    the other part of my application takes date from the field in DD/MM/YYYY format...
    so i have to convert my java.sql.date in YYYY/MM/DD format into DD/MM/YYYY format of same type before inserting into db......I am not sure why you are talking about formats here.
    There is no formatting inherent in a java.util.Date object
    nor in a java.sql.Date object.
    but using parse method in SimpleDateFormat class can get the result only in java.util.date format...
    and also using format method can result only in string conversion........You can easily create a java.sql.Date object from a java.util.Date object.
    String s = "31/12/2010";
    java.util.Date ud = new java.text.SimpleDateFormat("dd/MM/yyyy").parse(s);
    java.sql.Date sd = new java.sql.Date(ud.getTime());
    ud = sd; // java.sql.Date extends java.util.Date so no conversion is needed

  • How do I convert visa resource name into string?

    Could please anybody help? I have an ergent need. How do I convert visa resource name into string?
    Thank you in advance.

    Most times you do not need to convert it. Just wire it stright into what ever string input.
    See "Format Into Srting" or "Type Cast" functions
    Omar

  • XML document convert into String and Insert into Database

    Hello all,
         In the FIle to File Scenario  I want to send the data to the Reciever System in xml Document and convert into String and insert into Database.
      Please can you tell me exact way how to send it.
    Thanks & Regards,
    Raj

    HI,
    As per my understanding your scenario is File to file where you will get output fiel in XML format.
    Now that XMl payload need to be passed as single string in the database via XI.
    You cauld do this but you need to imply some manipulations such as
    With the help of standard API you need to concatenate the  XML tags and create the structre along with the data.
    For e.g. in your outpuf file the XML structre contain data as
    <field1>ABCD</field1>
    Then in mapping
    The source field will be mappeda s concat(<field1>) + value of  Source field "ABCD" + concat(</field1>) to the target field.
    This is the way that you could achive the requirments else there is no direct way avaialble for it.
    thanks
    Swarup

  • I want to convert two image files into strings and than to compare them. This is easy, but how to mention where the difference exist?

    I have two image file in bmp file format. How to convert them into string and to check if they are differnt or same. If different how to mention or find that where the difference exists. This idea have to be extented with video application as well.

    Hi,
    if you have vision, you could use the functin IMAQ Image to Array to have a 2D array of the pixel values.
    You can then compare pixel by pixel; if your images come from a camera, I would recommend to set a treshold of acceptance.
    This is a time consuming solution anyway.
    Alternative methods:
    1) Make a subtraction of the two images, the resulting image will be the difference of them
    2 ) Use IMAQ LogDiff function (operators palette)
    3) Calculate the histogram of both image and compare the histogram reports
    Good luck,
    Alberto

Maybe you are looking for

  • IPod Touch 2G 8GB wont turn on or connect to computer. Device Malfunctioned

    My iPod Touch 2G 8GB will not turn on or connect to my (or any other) computer or accesory. I'm not sure but I believe my USB cord may have been damp from a recent flood. When I plug it into a Vista computer, a popup reads "One of the usb devices att

  • How to process F-29 in mass?

    Hi all, I have many noted items (maybe 200) which I must associate to down payment request (F-29). Could you give me advice on the way to do this? (Using a specific program, a mass transaction...?) Thanks for your advice! David

  • Vista/Elements 5.0 RAW will not open

    I installed the Raw plug in 4.3.1 on XP and it worked fine. On a new computer with Vista I installed 5.02 to make Elements 5.0 work with Vista. Everything works but my ability to use/import RAW files from my Canon Rebel XTi which worked fine with XP.

  • Has anyone gotten myTextField.setSelection(startNum, endNum); to work?

    Perhaps I'm expecting the wrong result, but I can't get myTextField.setSelection(startNum, endNum); to select text in my TextField. var thisText_txt:TextField = new TextField(); thisText_txt.text = "test textfied"; addChild(thisText_txt); thisText_tx

  • HT1386 get itunes music library onto iPhone

    My iPhone app purchases are syncing fine to my laptop, but I can't get my laptop's music library in iTunes to sync onto the iPhone.  Help?