String convert

hi
just a stupid question maybe ...
but i'm missing some string convert functions.
e.g. i habe a list with something like:
text(space)text(space)text(spacespacespace)text
and want to convert one (or more) space(s) between the text into ONE tab.
i didn't found any function that makes me able to convert that so that i get
as a result:
text(tab)text(tab)text(tab)text
maybe someone has an idea?
thanks,

Hi Tobias,
use the functions "Scan from string" and "Format Into String"
with the format strings "%s\s%s\s..." and "%s\t%s\t..." like
in the VI attached to this mail.
maybe that helps you
best regards
Guenter
Tobias Theune wrote:
> hi
>
> just a stupid question maybe ...
> but i'm missing some string convert functions.
> e.g. i habe a list with something like:
> text(space)text(space)text(spacespacespace)text
> and want to convert one (or more) space(s) between the text into ONE tab.
> i didn't found any function that makes me able to convert that so that i get
> as a result:
> text(tab)text(tab)text(tab)text
>
> maybe someone has an idea?
>
> thanks,
Attachments:
Spaces_To_Tabs.vi ‏23 KB

Similar Messages

  • Binary String convertion.

    I've question on binary string convert to array of text/number.
    I'm tried to use GPIB read to retrieve a trace of Maxhold data (n number
    of frequency) from ESMI Spectrum Analyzer. however, those data always
    come out to binary string. So is there anyway i can convert Binary
    string --> ascii (in my case, array of number/text), or to retrieve
    readable data from the Spectrum Analyzer.
    Very appreciate for help.
    Jacky Wong

    I've question on binary string convert to array of text/number.
    I'm tried to use GPIB read to retrieve a trace of Maxhold data (n number
    of frequency) from ESMI Spectrum Analyzer. however, those data always
    come out to binary string. So is there anyway i can convert Binary
    string --> ascii (in my case, array of number/text), or to retrieve
    readable data from the Spectrum Analyzer.
    Very appreciate for help.
    Jacky Wong

  • String convert extended precision

    I'm writing a vi that sets a time stamp using the "Get Date/Time In Seconds.vi", converting the time stamp format into a double to get seconds, then I'm saving it as a string to a text file. When I read in the string from the file and use the "Decimal String To Number.vi" the output is limited to I32, which truncates the number to the upper I32 integer limit value of 2^31-1.
    Is there a better way to store a time stamp and do a later comparison, or convert the string directly into a double format from the file?
    Thanks!

    wawatts wrote:
    Is there a better way to ... convert the string directly into a double format from the file?
    Use the "Fract/Exp String To Number" function, not "Decimal String To Number" which converts strings to base10 integers (as you found out).
    =====================================================
    Fading out. " ... J. Arthur Rank on gong."

  • How can I preserve display string (convert DOB to Age) upon excel export?

    I am using the following code to convert DOB to age within Display String (Format Field/Common tab):
    if
    //months
    (datediff('yyyy',{CDCLIENT.DOB},currentdate)-(if datepart('y',currentdate)>datepart('y',{CDCLIENT.DOB}) then 0 else 1))<2 then
    totext(datediff('mm',{CDCLIENT.DOB},currentdate),0,'') & ' months'
    else
    //years
    totext((datediff('yyyy',{CDCLIENT.DOB},currentdate)-(if datepart('y',currentdate)>datepart('y',{CDCLIENT.DOB}) then 0 else 1)),0,'') //& ' years'
    When I export to excel/csv/ttx.. it doesn't export the display string (Age), but reverts back to the DOB. How do I preserve this upon export?

    Hi Dominic,
    The 'display string' formatted values are not exported to Excel Data Only.
    Create a 'formula field' as a workaround.
    -Abhilash

  • The problem with the strings Convert each other

    Hello all,
      Could you help me to solve the following problem using LV7.1? Thank in advance.
      How can I convert a string of "hexadecimal value" with Normal display style to other string of " the same hexadecimal value" with Hex display style?
    Best regards,
    Evan_Lv  

    Hi Evan,
    look at the attachment
    At the moment there is no error checking (any characters other than (0-9|A-F|a-f) will give an error; only even number of chars is converted). You can do the error checking as an exercise on your own!
    Message Edited by GerdW on 08-21-2007 09:08 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    HexString.vi ‏22 KB

  • Datetime to string convertion

    hi all,
    do you have any idea about, converting datetime type to string type?
    i select record from MSSql2000 database, and i try to write date-time field in textfield.
    rs.getTimeStamp("trh");
    textfield.setText(...);
    how can � convert datetime type to string type?

    hi all,
    do you have any idea about, converting datetime type
    to string type?
    i select record from MSSql2000 database, and i try to
    write date-time field in textfield.
    rs.getTimeStamp("trh");
    textfield.setText(...);
    how can � convert datetime type to string type? String val=rs.getTimeStamp("trh").toString();

  • Negativ Amount to String convert

    hi all
    how can i convert a negative amount(example 94.34-) to string. It should after convert like that -94.34.
    i want give the amount out in excel, with DOI......
    I hope you know, what i mean.....
    thx very much
    kostonstyle

    There's no need to use ABS and check the value to determine whether or not to concantenate.  One option is to write the value to your character like field then use CLOI_PUT_SIGN_IN_FRONT to move the sign position - it works whether the value is positive or negative...

  • String convert to list

    Hello:
    I need to convert a string in a list, I mean:
    I have this
    text1="list1"
    text2="list2"
    Now I need to use like parameters.
    Showlist text1
    On Showlist vlist
    list1=[1,2,3]
    list2=[A,B,C]
    put vlist --I need to show the content on list1 or list2
    end
    Can you help me please?
    Thank you

    Hi Arielle,
    There are three of ways to do it
    1. Use a propList (probably the best approach is you have a
    reasonably large list of lists)
    On Showlist vlist
    lookupList = [:]
    lookupList [&quot;list1&quot;]=[1,2,3]
    lookupList [&quot;list2&quot;]=[A,B,C]
    put lookupList .getAProp(vlist)
    end
    2. Use a case statement (best for a small list of lists)
    On Showlist vlist
    case (vList) of
    &quot;list1&quot;: out = [1,2,3]
    &quot;list2&quot;: out =[A,B,C]
    otherwise
    put &quot;Cannot find list &quot; &amp; vList
    end case
    put out
    end
    3. Use Lingos &quot;value&quot; command
    on Showlist (vList)
    aList = value(vList)
    -- now do some error checking
    if listP(aList) then put aList
    else put &quot;Error evaluating vList&quot;
    end

  • Boolean to string convertion

    HI,
    Is there any tool in labview 8 to convert string to boolean or boolean to string . The source is of boolean type and the sink is boolean type.
    Thanks
    SR

    I don't know why you start a new thread instead of adding to your existing thread here:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=193342
    In any case, most answers so far have dealt with formatting a boolean into a humanly readable string and back. Actually, I am not sure if that is what you want, because you talk about converting, not formatting.
    What exactly do you want to do?
    For example if you need to send a boolean via TCP, you need to convert it to a string, but it would make little sense to do any fancy formatting, turning a single byte into a longish humanly readable string. In this case you would just typecast to string, then cast it back to a boolean on the other end.
    The image shows one possibility.
    Message Edited by altenbach on 07-05-2006 10:40 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Bool-string-bool.png ‏3 KB

  • Array To Spreadsheet String -- Convert EOL Option

    The Array To Spreadsheet String and Spreadsheet String To Array functions should provide an option for (not) converting EOL (end-of-line) to platform-dependent ones. I am thinking of something similar to the Write/Read Text File options where you can place a checkbox in the context menu "Convert EOL". As per default such checkbox need to be checked for compatibility reasons.
    Possibly another option/checkbox for not appending the final EOL would be nice, maybe "Final EOL" checked per default as well.

    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:

  • Datatime to string convertion

    hi all,
    do you have any idea about, converting datetime type to string type?
    i select record from MSSql2000 database, and i try to write date-time field in textfield.
    rs.getTimeStamp("trh");
    textfield.setText(...);
    how can � convert datetime type to string type?

    1) rs.getString()
    2) DateFormat.format()

  • String convertion

    Hi, currently i'm developing a rule engine using JBOSS DROOLS 3.0
    and I try to write a rule editor instead of hardcode the rules
    i have a question in String mapping since i need to generate a DRL from DSL
    I have a configurable parameter, let's say "cardNo" and "userID" and these parameter is enclosed by {}
    Whenever the user input a new String, the program will map the input with the parameters
    and convert from {cardNo} to 10000 and {userID} to abcde
    But whenever there's multiple parameter, let's say {cardNo1}, {cardNo2}, {cardNo3}...
    I have problem in converting the message
    Maybe my explanation is a bit blur, but here's the example provided, hope it can help
    Input:
    - The card number is between {cardNo1} and {cardNo2} will be send to {userID}
    Output:
    - The card number is between 11111 and 22222 will be send to darontan
    Thanks

    As you said, you need a "map".
    Use a HashMap - key is string, value is the number.

  • HTML String Convertion .. Help please

    Dear All ,
    I have an application that convert any HTML input to another formula so the HTML will appear as it is ! for example :
    - if the input is :
    <B> HELLO </B>
    - The stored in the database will be :
    <B> HELLO </B>
    My Question is how can i covert this output back to it's original status. (<B> HELLO </B>)
    Please Help me
    Regards,
    Thanks

    Java is case sensitive! string != String
    If you meant:
    java.lang.String
    Then I'll be buggered if I know what your problem is .... it really should be working!?
    In a worst case senario, create your own replaceAll method:
    class myUtils
      public static String replaceAll( String str, String find, String replace )
        String result = "";
        if ( str == null || find == null || replace == null ) return result;
        for ( int i = 0, lastfind = 0; i < str.length; i++ )
          if ( str.subString(i).startsWith(find) )
            result += str.subString(lastfind,i) + replace;
            lastfind = i + find.length();
            i += find.length();
        return result;
    }Something like that should do it .... that was written of the top of my head and not tested or compiled .... so no promises! :p

  • String convertions

    Hi,
    Is there any routine or function module to have all special country characters translated into standard characters, let's say to A-Z a-z and 0-9 ?
    I mean all special characters codes because I get short dump that convertion fails. It is special characters from polish language, turkish and many more..
    BR

    hi dorota,
    the function module SCP_REPLACE_STRANGE_CHARS will do the job
    When you test the function module in SE37, make sure that you put a check in the checkbox Uppercase/Lowercase.
    Checks whether TRANSLATE .. TO UPPER/LOWER CASE statements are working in the correct language environment.
    TRANSLATE .. TO UPPER/LOWER CASE statements are displayed that work on table fields without a preceding SET LOCALE LANGUAGE statement.
    There are two cases:
    1. The table containing the field to which the TRANSLATE statement applies contains a language field.
    In this case, the data processed comes from a table containing a language field (regardless of whether the field occurs in the key). You can probably set the correct language environment before the TRANSLATE statement is executed.
    2. The table does not contain a language field.
    If the current table does not contain a language field, the error is harder to correct. You can either determine the language using other means, or add a language field to the table and fill it with the correct values.
    Note
    The TRANSLATE statement depends on the current language environment, which itself depends on the language in which the data was entered.
    Incorrect settings for the language environment can cause loss of data if, for example, you use the TRANSLATE statement to generate matchcodes.
    Examples of problems in the TRANSLATE statement:
    What is the UPPER CASE of 'ä'?
    In German - 'Ä'.
    In French - 'A'.
    In English, however, it would depend on the implementation, since 'ä' is not recognized at all.
    In Japanese, serious errors occur. The byte with the bit combination that looks like 'ä' is in fact the first half of the double-byte representation of many different kanji.
    If your try to process German data in a Russian environment, the result is variable: 'ä' and 'Ä' are processed correctly. However, 'ö' becomes '¦', and 'Ö' is converted to '¶'. The capital 'Ö' has a bit combination that stands for a small 'sch' in the Russian character set.
    When does the problem occur?
    1. Problems of this nature can occur if the wrong language environment has been set up using SET LOCALE. However, this is very rarely the case, and the system does not check for it.
    2. The problem can also occur if you do not use SET LOCALE at all and then process data that has a language other than the logon language, and this is a far more common cause. Since language key fields are not automatically filled, you cannot easily tell from an ABAP program whether it processes texts in foreign languages. (For comparison, think of clients, where you can recognize the source of data from the addition "CLIENT SPECIFIED".) Since this is not easily recognizable for languages, the extended program check lists critical points instead.You must either correct these or flag them as OK using a special pseudocomment.
    Check whether you have set the language environment correctly before the TRANSLATE statement, and if necessary, add a SET LOCALE LANGUAGE statement (as described in the examples below).
    Then, add the pseudocomment
    "EC TRANSLANG
    after the TRANSLATE statement (but on the same line) to indicate that the programming is correct.
    The extended program check automatically takes into account SET LOCALE LANGUAGE statements and 'SCP_MIXED_LANGUAGES_1_SWITCH' calls if they occur shortly before a TRANSLATE statement, but the pseudocomment is a safer way to ensure that the point in the program will not be listed in the check results.
    THere is a further pseudocomment
    "#EC SYNTCHAR
    to indicate that the TRANSLATE statement is allowed because the data only uses characters from the 'syntactical character set'.
    Solutions:
    There are several ways of solving the problems:
    The following examples suppose a table with a text field and a language key:
    DATA: BEGIN OF data OCCURS 0,
    langu LIKE sy-langu,
    txt(20) TYPE CHAR,
    END OF data.
    Solution 1:
    Old TRANSLATE data-txt TO UPPER CASE.
    |
    New proposal SET LOCALE LANGUAGE data-langu.
    TRANSLATE data-txt TO UPPER CASE.
    SET LOCALE LANGUAGE SPACE.
    This is a correct solution, and simple because it does not require wide-ranging changes to the program. Each TRANSLATE TO UPPER CASE statement occurs in the correct environment.
    The disadvantage is that there may be a large number of locale switches, and the SET LOCALE command takes up runtime. This solution also fails to account for two conditions, although these should not occur very often:
    The language in data-txt may be invalid. This would cause a runtime error.
    The program may not be running in the logon language. The SET LOCALE LANGUAGE SPACE statement always resets the locale to the logon language.
    Solution 2: With sort:
    If the data can be sorted without a problem because, for example, they are in an internal table that is not too large, it may be quicker to sort the data first. This minimizes the number of switches required:
    SORT data BY langu.
    LOOP AT data.
    IF data-langu >< SY-LANGU.
    SET LOCALE LANGUAGE data-langu.
    ENDIF.
    TRANSLATE data-txt TO UPPER CASE.
    ENDLOOP.
    SET LOCALE LANGUAGE SPACE.
    SORT data BY keyfield1 keyfield2.
    Solution 3: Several passes:
    This solution requires the most programming, and is only worthwhile if you need to process large amounts of data that could be processed sequentially, but would be time consuming to sort, and are not already sorted more or less by language.
    In the first pass, you only convert the texts that are already in the logon language. Additionally, you use COLLECT to note all of the other languages that occur in an internal table.
    You can then loop through the internal table, switch to the next language, and run through the entire dataset again.
    An example of this would be too long for this documentation. The "2nd procedure" in RSCP0104 is a test of this procedure.
    Solution 4: Only process the logon language:
    IF data-langu = sy-langu.
    TRANSLATE data-txt TO UPPER CASE. "#EC TRANSLANG
    ELSE.
    " Something important missing ?
    ENDIF.
    Other considerations
    SY-LANGU:
    SET LOCALE also changes the SY-LANGU field. Before processing more than TRANSLATE TO UPPER CASE and small, easy-to-understand actions, you should switch back to the logon language immediately, especially before calling new procedures.
    Languages:
    Depending on the data, it is possible that nosensical contents can appear for a given language key, that you are using a language that cannot be processed on a particular application server, or that a language is not properly installed.
    To ensure that application programs do not have to deal with these cases, there are four function modules that you can use:
    SCP_MIXED_LANGUAGES_1_INIT
    Called at the start of processing
    SCP_MIXED_LANGUAGES_1_SWITCH
    Switches to a paticular language
    SCP_MIXED_LANGUAGES_1_NORMAL
    Allows you to switch back temporarily to the language that was active when you called SCP_MIXED_LANGUAGES_1_INIT
    SCP_MIXED_LANGUAGES_1_FINISH
    Called at the end of processing.
    Like many function modules, these have few obligatory parameters for normal use, but do have a range of optional additional parameters for special cases.
    If you do not catch any exceptions, you can expect that the function module will either run successfully or that the program will terminate with a short dump. Using these functions, solution 1 looks like this: Lösung 1 folgendermaßen aus:
    CALL FUNCTION 'SCP_MIXED_LANGUAGES_1_INIT'.
    LOOP AT data. " Or SELECT, or...
    CALL FUNCTION 'SCP_MIXED_LANGUAGES_1_SWITCH'
    EXPORTING need_lang = data-langu.
    TRANSLATE data-txt TO UPPER CASE. "old code
    CALL FUNCTION 'SCP_MIXED_LANGUAGES_1_NORMAL'.
    ENDLOOP.
    CALL FUNCTION 'SCP_MIXED_LANGUAGES_1_FINISH'
    i think u will find some answer in it
    if it is useful reward some points
    Regards
    naveen

  • Strip html tags from string & convert ampelsand charachters

    hello, i'm converting html into xml, and i need to convert html code & content into xml content, withouth the html tags ...
    so, for example, I strip this out of an html file:
    <A NAME="b_betreft"></A>STUDIEOPDRACHT "UITBREIDING VIPA NAAR MEERDERE SUBSECTOREN" HERVERDELING VASTLEGGINGS- EN VEREFFENINGSKREDIETEN VAN HET VIPA VOOR HET JAAR 1999 ONTWERPBESLUIT VAN DE VLAAMSE REGERING TOT HERVERDELING VAN BASISALLOCATIES VAN DE BEGROTING VAN HET VLAAMS INFRASTRUCTUURFONDS VOOR PERSOONSGEBONDEN AANGELEGENHEDEN VOOR HET BEGROTINGSJAAR 1999<A NAME="e_betreft">
    and i want to get rid of the "<A NAME="b_betreft"></A>" & "<A NAME="e_betreft">", are there classes that can do this ???
    probably there are, i know in php there are ..., how about java ???
    also i'll need to correct stuff like:
    Financi&euml;le => Financi�le
    Comit&eacute=>Comit�
    you see, then, i'm done, cool ...
    thanks dudessssss

    hello, i'm converting html into xml, and i need to
    convert html code & content into xml content,
    withouth the html tags ...Why didn't you continue to post in your other thread?
    http://forum.java.sun.com/thread.jspa?threadID=777660
    It's not nice to create multiple threads with the same question.
    Kaj

Maybe you are looking for