Regular exp. question...

Hi,
I wrote a basic function which implements a saving  of two text data into  user selected files. The user chooses  one file name and the program should have appended a _CH_B string to the user selected name and saved the second file with that new generated name. For some reason my regular expression part does not work even though i checked the reg. exression on a stand alone engine. Please see my attached program
Message Edited by RSibagatullin on 07-30-2008 07:02 PM
Attachments:
TextSave2.vi ‏56 KB
current_path_20070710.vi ‏13 KB

I prefer less code.
Maybe try something like in the attached. Modify as needed.
(Seems oyu want to append, so add a few things inside the small FOR loop. )
Message Edited by altenbach on 07-30-2008 08:49 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
TextSave2MOD.vi ‏18 KB

Similar Messages

  • Regular exp

    Hello guys,
    I have something like this in a particular column
    /Jewel/Watches/ForHim/05645432454
    Using regular exp, How can i select whatever is coming before /05645432454. My result should be "/Jewel/Watches/ForHim". Basically the rule is what ever coming before that last '/' in the column is to be selected.
    Please help
    Thanks
    Edited by: user626688 on Aug 6, 2010 2:15 PM
    Edited by: user626688 on Aug 6, 2010 2:15 PM

    user626688 wrote:
    Hello guys,
    I have something like this in a particular column
    /Jewel/Watches/ForHim/05645432454
    Using regular exp, How can i select whatever is coming before /05645432454. My result should be "/Jewel/Watches/ForHim". Basically the rule is what ever coming before that last '/' in the column is to be selected.
    Please helpJust for my clarification, "exp" is not the old Oracle export utility, correct? You are just looking for the SQL commands that will allow you to return what is in front of the last "/" character, correct?
    The INSTR function is able to search from the last character position, and locate the right-most "/" character:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions068.htm
    Something like this:
    SELECT
      INSTR(COL1,'/',-1,1)
    FROM
      T1;With the position known, you can then use SUBSTR to return the left portion of the string - starting at the first character and extending to 1 less than the character position that was previously found:
    SELECT
      SUBSTR(COL1,1, INSTR(COL1,'/',-1,1) - 1)
    FROM
      T1;Charles Hooper
    Co-author of "Expert Oracle Practices: Oracle Database Administration from the Oak Table"
    http://hoopercharles.wordpress.com/
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • Regular Expressions - Questions to SME

    Ralph Benzinger presented an online meetup on the topic of Regular Expressions.  The presentation (slides only) can be found <a href="http://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/866072ca-0b01-0010-54b1-9c02a45ba8aa">here</a>
    Unfortunately the recording is not going to be available, but Ralph has been generous enough to agree to answer questions posted to this sticky thread.
    cheers,
    Marilyn

    Hello Peter,
    You're welcome!
    Alas, I was unable to locate the regex documentation on help.sap.com either.  In fact, I'm not even sure it has already been updated for 2004s.  I recommend that you use the online documentation within the system, e.g., from transactions SE38 or SE80.  Do an index search for "regex", and you'll be directed to REGEX, FIND and REGEX, REPLACE, both of which have extensive subsections on regexes.
    The class cx_sy_regex is an exception class that is thrown by FIND, REPLACE and cl_abap_regex in case of an invalid regex, such as ".\1" (there is no capture group that back reference \1 can refer to).  If the pattern is known statically, the syntax check will report this error, but for statements like "FIND REGEX pat IN text.", the actual pattern is only known at runtime.
    The cx_sy_matcher class (and its subclasses) similarly indicate some invalid states, for example trying to call "cl_abap_matcher->replace_found( )" when the matcher has no current match to replace (e.g., replace_found( ) called twice in a row).
    Please let me know if I can provide some additional information.
    Regards
    Ralph

  • Exp question

    I issued the following command to backup all objects owned by msd.
    exp msd/msd owner=msd file=/d1/dhurley/msd.dmp log=/d1/dhurley/msd.log \
    compress=n direct=y recordlength=32768
    The logfile is as follows
    Connected to: Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
    With the Partitioning option
    JServer Release 8.1.6.1.0 - Production
    Export done in WE8ISO8859P1 character set and WE8ISO8859P1 NCHAR character set
    . exporting foreign function library names for user MSD
    . exporting object type definitions for user MSD
    About to export MSD's objects ...
    . exporting database links
    . exporting sequence numbers
    . exporting cluster definitions
    . about to export MSD's tables via Direct Path ...
    . . exporting table MSD_BOOKING_DATA 0 rows exported
    . . exporting table MSD_CURRENCY_CONVERSIONS 0 rows exported
    . . exporting table MSD_DEMAND_PLANS 10 rows exported
    . . exporting table MSD_DP_DIMENSIONS 60 rows exported
    . . exporting table MSD_DP_EXPRESS_SETUP 9 rows exported
    . . exporting table MSD_DP_HIERARCHIES 90 rows exported
    . . exporting table MSD_DP_PARAMETERS 18 rows exported
    . . exporting table MSD_DP_SCENARIOS 9 rows exported
    . . exporting table MSD_DP_SCENARIO_ENTRIES 5568 rows exported
    . . exporting table MSD_DP_SCENARIO_EVENTS 0 rows exported
    . . exporting table MSD_DP_SCENARIO_INTRODUCTIONS 0 rows exported
    . . exporting table MSD_DP_SCENARIO_OUTPUT_LEVELS 50 rows exported
    . . exporting table MSD_EVENTS 0 rows exported
    . . exporting table MSD_EVENT_DETAILS 0 rows exported
    . . exporting table MSD_EVENT_PRD_DETAILS 0 rows exported
    . . exporting table MSD_EVENT_PRODUCTS 0 rows exported
    . . exporting table MSD_HIERARCHIES 9 rows exported
    . . exporting table MSD_HIERARCHY_LEVELS 29 rows exported
    . . exporting table MSD_INTRODUCTION_EVENTS 0 rows exported
    . . exporting table MSD_INTRODUCTION_PLANS 0 rows exported
    . . exporting table MSD_ITEM_LIST_PRICE 3 rows exported
    . . exporting table MSD_LEVELS 29 rows exported
    . . exporting table MSD_LEVEL_ASSOCIATIONS 71 rows exported
    . . exporting table MSD_LEVEL_VALUES 61 rows exported
    . . exporting table MSD_MFG_FORECAST 0 rows exported
    . . exporting table MSD_SALES_FORECAST 0 rows exported
    . . exporting table MSD_SALES_OPPORTUNITY_DATA 0 rows exported
    . . exporting table MSD_SHIPMENT_DATA 755 rows exported
    . . exporting table MSD_ST_BOOKING_DATA 0 rows exported
    . . exporting table MSD_ST_CURRENCY_CONVERSIONS 0 rows exported
    . . exporting table MSD_ST_ITEM_LIST_PRICE 0 rows exported
    . . exporting table MSD_ST_LEVEL_ASSOCIATIONS 0 rows exported
    . . exporting table MSD_ST_LEVEL_VALUES 0 rows exported
    . . exporting table MSD_ST_MFG_FORECAST 0 rows exported
    . . exporting table MSD_ST_SALES_FORECAST 0 rows exported
    . . exporting table MSD_ST_SALES_OPPORTUNITY_DATA 0 rows exported
    . . exporting table MSD_ST_SHIPMENT_DATA 0 rows exported
    . . exporting table MSD_ST_TIME 0 rows exported
    . . exporting table MSD_ST_UOM_CONVERSIONS 0 rows exported
    . . exporting table MSD_TIME 2192 rows exported
    . . exporting table MSD_UOM_CONVERSIONS 0 rows exported
    . exporting synonyms
    . exporting views
    . exporting stored procedures
    . exporting referential integrity constraints
    . exporting triggers
    . exporting posttables actions
    . exporting snapshots
    . exporting snapshot logs
    . exporting job queues
    . exporting refresh groups and children
    Export terminated successfully without warnings.
    The question is for the tables that were exported that did not contain any data the log states that 0 rows were exported. Did the table definition get exported? If there is a better forum to post this message please let me know and I apologize.
    Sincerely,
    Dan H.
    null

    Hi,
    The answer is Yes.
    You have made a User type export.
    So all the objects (definitions and data where available) are exported from the schema you specified.
    Cristian.
    null

  • Help: Regular Expression question??

    Hello,
    How can I extract the following content using Java Regular expression?
    <tr bgcolor="#333333">
         <td class="title" colspan="4" height="18"> <b>SUPER_1</b> - SUPER_2</td>
    </tr>
    <tr bgcolor="#333333">
         <td class="match-light" width="45" height="18"> </td>
         <td class="match-light" colspan="3" width="286" align="right">March 19 </td>
    </tr>
    <tr>
         <td colspan="4" height="1"></td>
    </tr>
    <tr bgcolor="#cfcfcf">
         <td width="45" height="18"> FT</td>
         <td width="118" align="right">SUPER_3</td>
         <td width="50" align="center"><a class="scorelink" target="details" onclick="showDetails();">999 - 888</a></td>
         <td width="118">SUPER_4</td>
    </tr>From the above contents, How can I define a regular expression for extract the "*SUPER_1*", "*SUPER_2*", "*March 19*", "*SUPER_3*", "*999*", "*888*" and "*SUPER_4*" ????
    Please help.
    Best regards,
    Eric

    Kayaman wrote:
    Why not use a better way than regex, like an actual HTML parser (or XML if you have it well-formed)? People seem to love parsing (or rather, asking help how to parse) HTML with regex for some unknown reason.Indeed.
    Read this (hilarious):
    http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454

  • How do I stop firefox from suggesting answers to regularly asked questions? ie: my name, email etc

    when I am taking a surevey, and questions are asked of me, like my name, address, email etc. firefox will suggest the answer that I have typed before. it appears underneath the box in which I am to type. how do I turn this function off

    *Click the (empty) input field on the web page to open the drop down list
    *Highlight an entry in the drop down list
    *Press the Delete key (on Mac: Shift+Delete) to remove it.
    *http://kb.mozillazine.org/Deleting_autocomplete_entries
    *https://support.mozilla.com/kb/Form+autocomplete
    *https://support.mozilla.com/kb/make-firefox-remember-usernames-and-passwords
    *Tools > Options > Privacy > Firefox will: "Use custom settings for history" > "Remember search and form history"
    *Tools > Options > Security: Passwords: "Remember passwords for sites"

  • Regular Expression Question

    Hi all,
    I am suffering in java regular expression, and I hope you guys can help me out. I want to use the String api ".matches" to find out any string pattern like "xxxx.xxxx" where xxx can be only english word(both upper and lower case). Actually I will use this kind of expression to represent the cross join SQL statement in my java class, like "tableA.name = tableB.name", where they should be english letter only. I tried to use MyString.matches("^[A-Z] + \\. + ^[A-Z]") in my java program, but seem it doesn't work. Can you guys figure out the right expression for me ?? Many thanks
    Transistor

    Thanks for your prompt response, I tried your code, however, it doesn't work out.
    I put your code like the following:
    if ( searchCriteria.getStringPair().getValue().trim().matches("[A-Za-z]+\\.[A-Za-z]+") {...some action }.
    Seems the java program never reach this expression.
    Kindly remind that I wan to expression anything like "xxxxx.xxxxx" where xxxx can be a word.
    Myriads of thanks
    Transistor

  • Regular Expression Question, Repetition Operators

    These are my success entries for a field;
    123456,
    123456,123456,
    123456,123456,123456,
    123456,123456,123456,123456,
    "," seperated 6 digits can be repeated unlimited times.
    I found on documentation this; "Repetition Operators; {m,}     Match at least m times" and for my need i tried this regular expression; "^[[[:digit:]]{6},]{1,}$", but didnt worked :(
    Any comments?
    Thank you very much :)
    Tonguc

    repeating exactly 6
    {6}
    repeating at least 1
    +
    repeating at least 6
    {6,}
    ok, your problem is [ instead of (                                                                                                                                                                                                                                                    

  • Regular Expression question I think

    My application is receiving HTML as a string and I'm trying to simplify it before displaying. The string could contain one or more substrings similar to this:
    <span style="cursor:pointer" onmouseout="hideTooltip()" onmouseover="createTooltip( this,'The quartile that your firm\'s value falls into.  Each quartile contains 25% of the values in the Peer Group. The 1st Quartile is always the best.  The 4th Quartile is always the worst.', ( findPosX( this ) - 150))">Quartile</span>The text will not be consistent and it may be in the string as many as 4 times. What I'd like to do is replaceAll so that I end up with
    <span>Quartile</span>Is there a way to do this with regular expression? I've tried replaceAll("<span .*>","<span>") But that takes out everything to the end of the String. I want it to stop at >.
    Any way?

    replaceAll("<span .*?>","<span>")

  • Regular expression question (should be an easy one...)

    i'm using java to build a parser. im getting an expression, which i split on a white-space.
    how can i build a regular-expression that will enable me to split only on unquoted space? example:
    for the expression:
    (X=33 AND Y=44) OR (Z="hello world" AND T=2)
    I will get the following values split:
    (X=33
    AND
    Y=34)
    OR
    (Z="hello world"
    AND
    T=2)
    and not:
    (Z="
    hello
    world"
    thank you very much!

    Instead of splitting on whitespace to get a list of tokens, use Matcher.find() to match the tokens themselves: import java.util.*;
    import java.util.regex.*;
    public class Test
      public static void main(String[] args) throws Exception
        String str = "(X=33 AND Y=44) OR (Z=\"hello world\" AND T=2)";
        List<String> tokens = new ArrayList<String>();
        Matcher m = Pattern.compile("[^\\s\"]+(?:\".*?\")?").matcher(str);
        while (m.find())
          tokens.add(m.group());
        System.out.println(tokens);
    }{code} The regex I used is based on the assumptions that there will be at most one run of quoted text per token, that it will always appear in the right hand side of an expression, and that the closing quote will always mark the end of the token.  If the rules are more complicated (as sabre150 suggested), a more complicated regex will be needed.  You might be better off doing the parsing the old-fashioned way, with out regexes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Regular expression question - match a template

    Hello All!
    I've put regex patterns to simple use b4, but this one I'm finding a bit of a challenge.
    I need to match lines to the following template:
    "9############ ###9,99 XXXXX####9,99 #9"In this template 9s mean digits, Xs mean alphanum characters and the #s mean optional digits.
    For example the following strings must mutch the above pattern:
    1. "123             18,10 abcde    9,99  1"
    2. "1234567890123 1000,99 CCCCC  260,99  2"This is the regex I came up with so far.
    "^[ \\d]{13}? [ \\d]{3}?\\d,\\d\\d .{5}?[ \\d]{4}\\d,\\d\\d [ \\d]\\d$"The problem with it of course is that it will match a string like:
    1. "9            9  9 ,99 abcde  9 9,99  1"Basically, the question is whether it is possible to ensure that when the optional digits are
    not present, they have the required spaces in their positions.
    Any help is much appreciated.
    P.s. the reason I am trying to use regex instead of splitting the string and validating the tokens
    separately is because I have a number of such templates to validate lines against, and each template signals a particular line type. :) Basically I need to decide what type of line is it I just read from a file...
    Thnx.

    First of all, isn't the first digit mandatory?
    That would mean that the first part of your regex should be:"^\\d"followed by 12 characters that can be either ' ' or any digit:"^\\d[ \\d]{12}"followed by space, three spaces or digits and a digit"^\\d[ \\d]{12} [ \\d]{3}\\d"comma, two digits, space, five alphanums"^\\d[ \\d]{12} [ \\d]{3}\\d,\\d{2} [\\w[^_]]{5}"4 space or digit, digit, comma, 2 digits"^\\d[ \\d]{12} [ \\d]{3}\\d,\\d{2} [\\w[^_]]{5}[ \\d]{4}\\d,\\d{2}"space, space or digit, digit, the end"^\\d[ \\d]{12} [ \\d]{3}\\d,\\d{2} [\\w[^_]]{5}[ \\d]{4}\\d,\\d{2} [ \\d]\\d$"And please note that the string you provided"9            9  9 ,99 abcde  9 9,99  1"is not supposed to match but the string"9                9,99 abcde    9,99  9"will.

  • Regular Expressions Question

    I am using regular expressions to parse through a text file generated by a set of sensors attached to a SeaBird CTD profiler, what matter is that some lines use quotes as a special marker and some dont, but I need to treat both as the same data. Here is the example:
    SeaBird Datafile (just some part):
    "# name 0 = depS: depth, salt water [m]"
    "# name 1 = t068: temperature, IPTS-68 [deg C]"
    # name 2 = sal00: salinity, PSS-78 [PSU]
    "# name 3 = sigma-t00: density, sigma-t [kg/m^3]"
    "# name 4 = flS: fluorometer, sea tech"And I am using this regular expression to read this lines and save those names:
    private static final String ColumnName = "(^\"#|^# ) name (\\d)+ = ((.+)\"$|(.+)$)";There is a possiblity that the string either starts with "# and ends with ", or that it only starts with # and no special marker to the end. Can anyone enlighten me on the correct regex because the one I posted up there only works in the case of being surrounded by quotes. Thanks in advance!
    Christian A. Sueiras

    Try this: private static final String ColumnName = "^(\"?)# name (\\d+) = (.+)\\1$";{code} You match an optional quotation mark at the beginning, and capture it in group #1.  At the end, you match whatever was captured in group #1: either a quotation mark, or nothing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • A regular expression question

    I have a large body of text which I am breaking into individual words (as part of an experimental indexing project.)
    I can break the text into a list by making a paragraph break for every word space (a simple find and replace).
    But I want proper names to remain unbroken.
    So I am trying to write a regular expression script which will find every occurence of two contiguous words which each begin in a capital letter, and then to replace the space between the two words with an underscore.
    So Sigmund Freud becomes Sigmund_Freud.
    Does anyone know how I would write this script?
    Thanks!!!

    You don't need a script, you can do it in the interface:
    Find: (\u[-\w]+)\x{20}(?=\u[-\w]+)
    Change: $1_
    \u[-\w]+ stands for "upper-case letter followed by one or more of hyphen/word character"; here the first name.
    \x{20} stands for the space.
    followed by another \u[-\w]+, the last name. This one is in a lookahead, so the whole expression paraphrases as "find a word that starts with an upper-case letter followed by a space if it's followed by another word starting with an uc letter".
    Peter

  • Validation on text item as Regular Expression Question(Repetition Operator)

    These are my success entries for a field;
    123456,
    123456,123456,
    123456,123456,123456,
    123456,123456,123456,123456,
    "," seperated 6 digits can be repeated unlimited times.
    I found on documentation this; "Repetition Operators; {m,}     Match at least m times" and for my need i tried this regular expression; "^[[[:digit:]]{6},]{1,}$", but didnt worked :(
    Any comments?
    Thank you very much :)
    Tonguc

    Your expression is a little incorrect because you can't use repetition operators within a bracket expression. How about something like this
    "^([[:digit:]]{6},)+$"
    Regards,
    Peter

  • Quick regular expression question/help

    Can someone help me with two regular expressions I need. I could spend a while trying to figure it out myself, however times short and I really would like to get a fool proof optimal solution (my attempt would be buggy).
    Sample sentence
    The population, is projected to reach 200,000, or more (by 2020).[7] This is {dummy} text.
    The first regular expression
    I need all brackets and every thing between them to be removed from a sentence.
    Brackets such as: ( ), [ ] and { } .
    I.e. Given the above sentence the following would be returned:
    The population, is projected to reach 200,000, or more. This is text.
    The second regular expression
    If a word has a trailing comma character I need to add a whitespace between the word and the comma.
    I.e. Given the sentence returned from the first regular expression, this regex would return:
    The population *,* is projected to reach 200,000 *,* or more. This is text.
    Many thanks to anyonewho can help me with this!
    Edited by: Myles on Jan 18, 2008 8:12 AM

    http://java.sun.com/docs/books/tutorial/extra/regex/index.html
    http://www.regular-expressions.info

Maybe you are looking for