Formatting a string with Display String

I have a field in my database that is a string with numbers in it and I need it formatted like so: "xx-xx-xx-xxx" nine characters long.
For example: 92438014
I need it to look like: 09-24-38-014
and
141234892
14-12-34-892 etc..
can anyone help me with some code that will do this for me? I'm not the best at crystal custom formatting.
thank you
Edited by: MarcieHennessy on Oct 14, 2009 10:47 PM

Raghavendra.G
I was on this site searching for an answer to my problem, and you provided the solution for me with your response to the above.  However, my problem was a bit different.  I needed a way to format a 9-digit number string into a standard Social Security number format.  I used your formula from above, and WOW - it worked!  If I could award you double Forum Points, I would.  But, since I can't do that, I will just say thanks, and ask God to bless you profusely.
Kathryn J. Ryan.

Similar Messages

  • Replacing a special character in a string with another string

    Hi
    I need to replace a special character in a string with another string.
    Say there is a string -  "abc's def's are alphabets"
    and i need to replace all the ' (apostrophe) with &apos& ..which should look like as below
    "abc&apos&s def&apos&s are alphabets" .
    Kindly let me know how this requirement can be met.
    Regards
    Sukumari

    REPLACE
    Syntax Forms
    Pattern-based replacement
    1. REPLACE [{FIRST OCCURRENCE}|{ALL OCCURRENCES} OF]
    pattern
              IN [section_of] dobj WITH new
              [IN {BYTE|CHARACTER} MODE]
              [{RESPECTING|IGNORING} CASE]
              [REPLACEMENT COUNT rcnt]
              { {[REPLACEMENT OFFSET roff]
                 [REPLACEMENT LENGTH rlen]}
              | [RESULTS result_tab|result_wa] }.
    Position-based replacement
    2. REPLACE SECTION [OFFSET off] [LENGTH len] OF dobj WITH new
                      [IN {BYTE|CHARACTER} MODE].
    Effect
    This statement replaces characters or bytes of the variable dobj by characters or bytes of the data object new. Here, position-based and pattern-based replacement are possible.
    When the replacement is executed, an interim result without a length limit is implicitly generated and the interim result is transferred to the data object dobj. If the length of the interim result is longer than the length of dobj, the data is cut off on the right in the case of data objects of fixed length. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or hexadecimal zeroes. Data objects of variable length are adjusted. If data is cut off to the right when the interim result is assigned, sy-subrc is set to 2.
    In the case of character string processing, the closing spaces are taken into account for data objects dobj of fixed length; they are not taken into account in the case of new.
    System fields
    sy-subrc Meaning
    0 The specified section or subsequence was replaced by the content of new and the result is available in full in dobj.
    2 The specified section or subsequence was replaced in dobj by the contents of new and the result of the replacement was cut off to the right.
    4 The subsequence in sub_string was not found in dobj in the pattern-based search.
    8 The data objects sub_string and new contain double-byte characters that cannot be interpreted.
    Note
    These forms of the statement REPLACE replace the following obsolete form:
    REPLACE sub_string WITH
    Syntax
    REPLACE sub_string WITH new INTO dobj
            [IN {BYTE|CHARACTER} MODE]
            [LENGTH len].
    Extras:
    1. ... IN {BYTE|CHARACTER} MODE
    2. ... LENGTH len
    Effect
    This statement searches through a byte string or character string dobj for the subsequence specified in sub_string and replaces the first byte or character string in dobj that matches sub_string with the contents of the data object new.
    The memory areas of sub_string and new must not overlap, otherwise the result is undefined. If sub_string is an empty string, the point before the first character or byte of the search area is found and the content of new is inserted before the first character.
    During character string processing, the closing blank is considered for data objects dobj, sub_string and new of type c, d, n or t.
    System Fields
    sy-subrc Meaning
    0 The subsequence in sub_string was replaced in the target field dobj with the content of new.
    4 The subsequence in sub_string could not be replaced in the target field dobj with the contents of new.
    Note
    This variant of the statement REPLACE will be replaced, beginning with Release 6.10, with a new variant.
    Addition 1
    ... IN {BYTE|CHARACTER} MODE
    Effect
    The optional addition IN {BYTE|CHARACTER} MODE determines whether byte or character string processing will be executed. If the addition is not specified, character string processing is executed. Depending on the processing type, the data objects sub_string, new, and dobj must be byte or character type.
    Addition 2
    ... LENGTH len
    Effect
    If the addition LENGTH is not specified, all the data objects involved are evaluated in their entire length. If the addition LENGTH is specified, only the first len bytes or characters of sub_string are used for the search. For len, a data object of the type i is expected.
    If the length of the interim result is longer than the length of dobj, data objects of fixed length will be cut off to the right. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or with hexadecimal 0. Data objects of variable length are adapted.
    Example
    After the replacements, text1 contains the complete content "I should know that you know", while text2 has the cut-off content "I should know that".
    DATA:   text1      TYPE string       VALUE 'I know you know',
            text2(18)  TYPE c LENGTH 18  VALUE 'I know you know',
            sub_string TYPE string       VALUE 'know',
            new        TYPE string       VALUE 'should know that'.
    REPLACE sub_string WITH new INTO text1.
    REPLACE sub_string WITH new INTO text2.

  • Replace a string with another string in a file

    I have to replace a string with another string. Say for example in a html file it got a line like,
    <a href="##"></a>
    now i want to replace this ## with the full derived path like
    "c;\\sample folder\\sample subfolder\\samplefile.html"
    can someone help me to do this?
    pls tell me from the file opening till closing the file.

    I have to replace a string with another string. Say
    for example in a html file it got a line like,
    <a href="##"></a>
    now i want to replace this ## with the full derived
    path like
    "c;\\sample folder\\samplesubfolder\\samplefile.html"
    can someone help me to do this?
    pls tell me from the file opening till closing the
    file.
    public class Buckel {
      final static String CONST = "c:\\sample folder\\samplesubfolder\\samplefile.html";
      public Buckel() {
      public static void main ( String[] argv )  throws Exception {
        int    idx = 0;
        String in  = "<a href=\"##\"></a>",   // We'll imagine this just gets here somehow. If it's on the i/p file then take the '\' out B4 and aft the '##'.
               out = "";
        idx = in.indexOf( "##" );
        if ( idx > 0 ) {
          out = in.substring( 0, idx ) + CONST + in.substring( idx+=2, in.length() );
        System.out.println( out );
    }

  • How can I substitute a string with another string in a file

    I have a file. I have a substitute a keyword with another string in all the occurences of a file. How can I do this?

    I'm gonna give you the benifit of the doubt and assume you didn't mean to double post your question.
    As to substitute a keyword with a string one way is to read in the file and run it through a StreamTokenizer class to break it into words. Pull one word at a time, check it, and stick it into a StringBuffer. Once your done with the file overwrite it with what is in the StringBuffer.
    Another way might be to use the RandomAccessFile class, but I'm not really familiar with that because I hardly ever use it.

  • Error when dynamically acquiring string with variable string length

    Hi,
    I have written a VI to send voltage signal and read back the channel 1 and channel 2 data of a SR830 lockin amplifier using serial port. I obtain the channel readings as a single string separated by "," using the snap function. The problem is that when ever the channel 2 data gets very close to zero then the output is in engineering format like say 6.73883e-005. This is where the problem occurs. When such a situation is encountered, I always get a time out error. I have tried to increase the byte count in the read VISA ( till around 50) but then I get this error more often, but if I reduce it to something like 17, I only get this error as I mentioned above only when the channel 2 reading is very nearly zero. I have tried to reduce the byte (to as low as 8), but then I donot get back the whole channel 2 reading (this ch2 reading is also important to me). I am in a fix. Please give me a way out.
    I am attaching here the VIs.
    Attachments:
    C-V measurement by SR830.vi ‏107 KB
    sr830readout1.vi ‏31 KB
    sr830 initialize.vi ‏15 KB

    I am really sorry for the late reply. Well, I tried to increase the time constant inthe sr830 initialize VI, upto 240,000 ms. But I still get the error, and not always now when the reading is near zero. Can you please tell me whats wrong? I am in my very early days in labview and this is infact the first program I have written. BTW i am using a serial port to communicate with the SR830 lockin amplifier. Can you tell me in this context how I use SRQ? thanks in advance.

  • Concatenate hex string with ASCII string

    Hello,
    I'm new to LabView and I'm building an application that speaks to a camera. I'm stuck at something that seems quite basic: I need to concatenate a constant string of hex values (0002 040D ...) with an ASCII string of hex characters (00D0A10F, for example), that comes out of a "Number to Hex string" block. The output should be a string of hex values (0002 040D 00D0A10F) and go to the camera, but the concatenate block turns the ASCII string into hex display too, so that every character is converted to two hex symbols....
    I found a very old post where someone claims they found a solution; unfortunately, it's not posted...
    Does someone have an idea what do to do?
    Thanks a lot!
    Michal
    Solved!
    Go to Solution.

    Hi,
    Give this a try - it converts an ASCII string of hex characters into the ascii characters.
    So, if you view the output as hex, it should concatenate properly with your other data.
    Dan
    Dan
    CLD
    Attachments:
    hex to ascii.vi ‏8 KB

  • Replaces all occurnces of one String with another String in a given source

    Hi all I had found that there is a lot of interest int this topic. there is a little piece of code that I wrote for myself recently, so I fgigured that it might be helpful for some...
    This method will scan through a string "source", find all of the occurances of a String "before" and replace them with the "after".
    Enjoy :-)
    public static String replace(String source, String before, String after)
    StringBuffer sb = new StringBuffer(source);
    int startpos = source.indexOf(before);
    int endpos = startpos + before.length();
    int i = startpos;
    while( i > -1 )
         if( startpos > -1 && endpos <= source.length() )
         source = sb.replace(startpos, endpos, after).toString();
         int lastReplace = source.lastIndexOf(after) + after.length();
         if(lastReplace <= source.length())
              startpos = source.substring(lastReplace, source.length() ).indexOf(before);
                   endpos = startpos + before.length();
                   i = startpos;
         else
              i = source.length();
         else
              i = -1;
    return source;
    Oh yeah if you want, you can visit my site http://www.infobrokery.com it is where this code is used to replace the text URL with html.

    Since 1.4 the String class has a replaceAll method ...

  • How to replace part of a String with another String :s ?

    Got a String
    " Team_1/Team_2/Team_3/ "
    And I want to be able to rename part of the string (they are seperated by '/'), for example I want to rename "Team_3" to "Team C", and "Team_1" to "Team A" while retaining the '/' character how would I do this?
    I have tried using String.replace(oldValue, newValue); but this doesnt work, any ideas?

    What do you mean that it doesn't work? You do know that the method returns the modified string? The actual string that you invoke the method on is not altered.
    /Kaj

  • How to replace a particular striing with another string in jtextpane

    how to get replace a particular string with another string of a jtextpane without taking the text in a variable using getText() method .

    Thanks for your answer,
    "relevant object" means for you datasources, transfer rules and transformations ?
    With the grouping option "Save for system copy" I can't take easily all datasources, and others objects
    Will I have to pick all object one by one ?
    What would be the adjustement in table RSLOGSYSMAP ? For the moment it's empty.
    Regards
    Guillaume P.

  • Replacing a part of a String with a new String

    Hi everybody,
    is there a option or a method to replace a part of a String with a String???
    I only found the method "replace", but with this method I only can replace a char of the String. I don't need to replace only a char of a String, I have to replace a part of a String.
    e.g.:
    String str = "Hello you nice world!";
    str.replace("nice","wonderfull");   // this won't work, because I can't replace a String with the method "replace"
                                        // with this method I'm only able to replace charsDoes anyone know some method like I need???
    Thanks for your time on answering my question!!
    king regards
    IceCube-D

    do check java 1.4 api, I think there is a method in it, however for jdk1.3 you can use
    private static String replace(String str, String word,String word2) {
         if(str==null || word==null || word2 == null ||
               word.equals("") || word2.equals("") || str.equals("")) {
              return str;
         StringBuffer buff = new StringBuffer(str);
         int lastPosition = 0;
         while(lastPosition>-1) {
              int startIndex = str.indexOf(word,lastPosition);
              if(startIndex==-1) {
                   break;
              int len = word.length();
              buff.delete(startIndex,startIndex+len);
              char[] charArray = word2.toCharArray();
              buff.insert(startIndex,charArray);
              str = buff.toString();
              int len2 = startIndex+word2.length();
              lastPosition = str.indexOf(word,len2);
         return buff.toString();

  • Failure to read multiline string with Read Key.vi

    I converted 2D array into a spreadsheet string and attempetd to write it as a key value into a configuration file. This worked just fine. However, when I attempted to read this multiline string using Read Key.vi, I got just the first line in return (see two vi's attached).
    As sufficient documentation on configuration file vi's is all but missing, could you please advise on their (undocumented) features? What do I miss?
    Thank you.
    Michael
    Attachments:
    Save_2D_array_in_config_file.vi ‏29 KB
    Read_2D_array_from_config_file.vi ‏31 KB

    Hi Michael,
    MichaelS wrote in news:506500000008000000F7980000-
    [email protected]:
    > I converted 2D array into a spreadsheet string and attempetd to write
    > it as a key value into a configuration file. This worked just fine.
    > However, when I attempted to read this multiline string using Read
    > Key.vi, I got just the first line in return (see two vi's attached).
    I use Config files all the time. Much more user-friendly than the
    Registry. They are a Microsoft thing really, rather than LabView, and
    come from Windows 3.11. Each value is limited to one line, so when you
    write a spreadsheet string with end-of-line characters in it, you're
    effectively breaking the .inf file
    The solution? Try putting a "Search and Replace String
    " after your
    "Array To Spreadsheet String". Wire "Replace All" with a TRUE constant,
    and wire "Search String" with a string in "\" view and enter \r\n (or do
    0A0D in Hex view) and then then wire Replace String with a ";"
    Now your .inf file will look like:
    [Array]
    Data=1.0000,0.0000,0.0000;0.0000,2.0000,0.0000;0.0000,0.0000,3.0000;
    When reading it, just reverse the search and replace strings above.
    I hope this helps,
    Andrew

  • Reading a String with dynamic format.

    Hello,
    I'm learning Java and I'm relatively new to the scene. I decided to make a small free utility with the hope that it will help somebody. The utility is a Game Server (Call of Duty 4) connector that will help Administrators to connect to the server and execute commands without the need of running the game.
    I have made a progress so far by searching these (very useful) forums but I came across a point that I can't by pass.
    The only way to learn "Who Is" from the server is the rcon command "status". Using this command the server returns you the current map and the players playing with all their information. This is the part of the code that I need help at:
    public static void StatusReader(String StatusInput) throws IOException {
                     ArrayList line = new ArrayList();
                        BufferedReader br = new BufferedReader(new StringReader(StatusInput));
                       String s = null;
                       int l=0;
                  dokimi = StatusInput.split("\n");
             //    for(int j=0;j<9;j++){
              //        int i=0;
              //        dokimi2 = new String[0][0];
              //        dokimi2[0][0] = dokimi[0];
              //        System.out.println(dokimi2[0][0]);
                  System.arraycopy(dokimi, 0, dokimi2, 0, 1);
                for(int i=0;i<(dokimi.length/9);i++){
                        for(int j=0;j<9;j++){    
                       dokimi2 = new String[i][j];
                       System.arraycopy(dokimi, 0, dokimi2[i][j], 0, 1);
                       System.out.println(dokimi2[i][j]);
             //     while ((s = br.readLine()) != null)
                  //     line.add(s);
                   //  StatusOutput = new String[line.size()][];
                  //     for (int i = 0; i < StatusOutput.length; i++) {
                  //               s = (String) line.get(i);
                       //          StringTokenizer st = new StringTokenizer(s, "");
                  //               String[] arr = new String[st.countTokens()];
    //                       for (int j = 0; j < arr.length; j++)
      //                                arr[j] = st.nextToken();
            //               StatusOutput[i] = arr;
               //          for (int i = 0; i < StatusOutput.length; i++) {
          //                    for (int j = 0; j < StatusOutput.length; j++)
    //                         System.out.print(StatusOutput[i][j] + " ");
         //                    System.out.println();
    }I've been messing a lot with the code. +_What I want to do is to read this string that the server is sending,split it, and then place it in a 2D Array that I will attach on a table._+ So far I've made the StringTokenizer method to be able to , kind of, sort that String and put it in an array. However I usually get outofbounds errors because not always the lines have the same length. This is an example of the format that the server sends after executing the "status" command:map: mp_crossfire
    num score ping guid name lastmsg address qport rate
    2 1 84 b5e9d93e88670c6f811a033a7f925117 Davis^7 0 84.185.183.210:-1482 21249 25000
    4 15 100 e0d7c91fa7ba9549444ccab3a0e3de62 =HPX= Anogianos^7 0 91.140.25.93:28960 -10752 25000
    5 5 68 5d68298d9e16d7491d5700e6e236214f AsChIkUtAbU^7 50 84.60.215.190:17502 26401 25000
    6 115 44 cc503f50d990e27eeb990826c2cf1193 Donnergroll^7 50 91.64.153.240:28960 10086 25000
    7 141 79 cbd095d37abdc728671e2923296aa9cf souL^7 50 87.78.179.242:-10509 8432 25000
    8 116 83 4d0d1a067179516e209ef89cb0a79755 suodeth^7 0 84.250.214.156:27185 -29970 25000
    9 11 117 fc3c6777b3d9bf99df1e55b321b75e9e shpalman^7 50 62.101.126.209:-17420 -25455 25000
    10 5 82 fb2f20a9f46a212b896baf9ab4ea3eb0 =HPX=Gringo^7 50 213.5.170.94:-619 20175 25000
    11 95 68 d3d542b17ab56d9fbf107da39f245269 aga^7 50 78.2.42.253:28960 22173 25000
    12 10 100 8e6d08aec08591fb319081d0b40dedd2 madmax^7 0 79.166.47.145:2960 -7933 25000
    13 110 77 4fc4d0e24faa634dbce5c4bb4131bc4a Thunderstorm^7 50 87.78.113.218:28960 4512 25000
    14 55 67 f789227fcb95853b857115e68741df8d Robbino^7 0 89.217.12.113:28960 -192 25000
    15 118 85 b7be8ce58324d0f25c45f5cb372b30a1 Paranoid^7 50 78.1.26.32:28960 27294 25000
    16 11 90 38b59f3bbd3aa0ce3c95fccb26858931 $Hockz^7 50 87.181.101.96:-2984 24219 25000
    19 16 45 720f2abf81189890851d3e41fcbe4e21 ERASER^7 50 83.236.63.150:-32135 24704 25000
    20 145 37 a78f43bc3d3705743a190de45d37fc6a KintaKunte^7 50 88.68.237.239:28960 23539 25000
    21 60 49 a96d6a55049d11c5d7cd1c35c4d497c3 #sD|-HaZarD-^7 50 87.78.179.242:-10509 8432 25000
    8 116 83 4d0d1a067179516e209ef89cb0a79755 suodeth^7 0 84.250.214.156:27185 -29970 25000
    9 11 117 fc3c6777b3d9bf99df1e55b321b75e9e shpalman^7 50 62.101.126.209:-17420 -25455 25000
    10 5 82 fb2f20a9f46a212b896baf9ab4ea3eb0 =HPX=Gringo^7 50 213.5.170.94:-619 20175 25000
    11 95 68 d3d542b17ab56d9fbf107da39f245269 aga^7 50 78.2.42.253:28960 22173 25000
    12 10 100 8e6d08aec08591fb319081d0b40dedd2 madmax^7 0 79.166.47.145:2 0 91.3.110.248:-1185 6274 25000
    23 116 109 bfffdf9ff93425d284796532ef214bd0 ze_meedles^7 50 85.243.221.116:28960 24936 25000
    95853b857115e68741df8d Robbino^7 0 89.217.12.113:28960 -192 25000
    15 118 85 b7be8ce58324d0f25c45f5cb372b30a1 Paranoid^7 50 78.1.26.32:28960 27294 25000
    16 11 90 38b59f3bbd3aa0ce3c95fccb26858931 $Hockz^7 50 87.181.101.96:-2984 24219 25000
    19 16 45 720f2abf81189890851d3e41fcbe4e21 ERASER^7 50 83.236.63.150:-32135 24704 25000
    20 145 37 a78f43bc3d3705743a190de45d37fc6a KintaKunte^7 50 88.68.237.239:28960 23539 25000
    21 60 49 a96d6a55049d11c5d7cd1c35c4d497c3 #sD|-HaZarD-^7 50 87.78.179.242:-10509 8432 25000
    8 116 83 4d0d1a067179516e209ef89cb0a79755 suodeth^7 0 84.250.214.156:27185 -29970 25000
    9 11 117 fc3c6777b3d9bf99df1e55b321b75e9e shpalman^7 50 62.101.126.209:-17420 -25455 25000
    10 5 82 fb2f20a9f46a212b896baf9ab4ea3eb0 =HPX=Gringo^7 50 213.5.170.94:-619 20175 25000
    11 95 68 d3d542b17ab56d9fbf107da39f245269 aga^7 50 78.2.42.253:28960 22173 25000
    12 10 100 8e6d08aec08591fb319081d0b40dedd2 madmax^7 0 79.166.47.145:2As you can see the problem is that the server sends some information twice *but* it splits them with a blank line. In addition some nicknames contain spaces something that makes me wonder how I can set the nicknames to belong to the same position of the array. Something that i know is that all nicknames end with "^7" which is the in-game colour definition. Any help would be much appreciated. Thanks in advance.
    Edited by: m33ts4k0z on Dec 21, 2007 11:36 AM
    Edited by: m33ts4k0z on Dec 21, 2007 11:43 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    m33ts4k0z wrote:
    Hello DeltaGeek and thanks for your answer.
    I have 2 questions for you since you mentioned what the real problem is. The first question is how can I join 2 cells that will contain the 2 parts of the nickname in case of a space? Can I just check if the cell number x,y contains "^7" and then just copy that cell the x,y-1? Ive tried that but then I also have to move the rest of the columns to y-1 as well. Any idea how to do that?
    I was assuming you'd be processing the split string anyways, and not just tossing it into your 2-d structure. If you want to use .split(), yes. you would need to merge those cells into the original name. System.arrayCopy() would likely be useful for doing most of the heavy lifting.
    Another option you have is to tokenize the string using Scanner. That would let you pull each column out of the string individually. You'll need to populate the array manually (instead of just using what .split() gives you), but allows you to change the token delimiter between pulls.
    As for the junk lines, I can just check if they don't much the tokens number and then just not add them to the array I suppose, am I right or....?That's certainly one option. I don't know what's being given back to you, it may be important.

  • 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

  • How to display string with XML content in 4.6?

    Hi,
    I`d like to know how to display string with XML content in it for 4.6.
    4.6 has not method parse_string.
    And example like this is not helpful:
      DATA: lo_mxml    TYPE REF TO cl_xml_document.
      CREATE OBJECT lo_mxml.
      CALL METHOD lo_mxml->parse_string
        EXPORTING
          stream = gv_xml_string.
      CALL METHOD lo_mxml->display.
    Thank you.

    Hi,
    May be you can use fm SAP_CONVERT_TO_XML_FORMAT. But it have some issues with memory usage, the program consumed tons of memory during convert.

  • 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

Maybe you are looking for

  • How to Activate the Table which Doesn't Exist - Can I create Table in SE11

    Hi Gurus, I am a BASIS Person ..so, I don't have much idea about ABAP Developement side . But, while applying patches to one of  the SAP Component, I get the following error message ( usr\sap\trans\log ) : Phase Import_Proper >>> SAPAIBIIP7.BID 1 ED0

  • Fitering a maintenance call

    Hi guys! I have a maintenance call and I want to show it, like as with SM30, but only for some records.  I have a program that call it with VIEW_MAINTENANCE_CALL function.  I guess this function may have some parameter to filter the selection or may

  • Import from digital camera no longer works

    iPhoto 6.0.6 I suddenly can't import photos from my Casio digital camera. It worked fine two months ago, with the same computer and the same camera. When I connect the camera to the computer, and turn the camera on, the camera appears on the Desktop,

  • Dynamic Mail Messenger - mail to distribution list

    Hi Mentors, The requirement is to generate an automatic mail when an employee updates his marital status or children status in IT0002. The mail has to go to the master data administrator and one of the persons in the Accounts team to initiate insuran

  • WHERE DID THE PICTURES GO???

    My iphoto 5 is not showing me my pictures! I spoke to an apple representative and he directed me here. I really hope someone can help me! Apparently my pictures have become corrupt or unreadable. Is there a way for me to be able to find them again on